Пример #1
0
void DiscoverResourceUnit::discoverdCB(RCSRemoteResourceObject::Ptr remoteObject, std::string uri)
{
    if (remoteObject && !isAlreadyDiscoveredResource(remoteObject))
    {
        RemoteResourceUnit::Ptr newDiscoveredResource =
            RemoteResourceUnit::createRemoteResourceInfo(remoteObject, pUpdatedCBFromServer);

        if (uri.empty() || uri.compare(remoteObject->getUri()) == 0)
        {
            m_vecRemoteResource.push_back(newDiscoveredResource);
            newDiscoveredResource->startMonitoring();
            newDiscoveredResource->startCaching();
        }
    }
    else
    {
        // Already Discovered Resource
    }
}
Пример #2
0
TEST_F(RemoteResourceUnitTest, startMonitoring)
{
    RemoteResourceUnit::Ptr ptr = m_pRemoteResourceUnit->createRemoteResourceInfo(
                                      m_pRCSRemoteResourceObject, m_updatedCBFromServer);
    ptr->startMonitoring();
}