IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OIC::Service::RCSDiscoveryManager Class Reference

This class contains the resource discovery methods. More...

Classes

class  DiscoveryTask
 This class represents a discovery task. More...
 

Public Types

typedef std::function< void(std::shared_ptr
< RCSRemoteResourceObject >) > 
ResourceDiscoveredCallback
 Typedef for callback of discoverResource APIs. More...
 

Public Member Functions

DiscoveryTask::Ptr discoverResource (const RCSAddress &address, ResourceDiscoveredCallback cb)
 Discovers resources of interest, regardless of uri and resource type. More...
 
DiscoveryTask::Ptr discoverResource (const RCSAddress &address, const std::string &relativeUri, ResourceDiscoveredCallback cb)
 Discovers resources of interest, regardless of resource type. More...
 
DiscoveryTask::Ptr discoverResourceByType (const RCSAddress &address, const std::string &resourceType, ResourceDiscoveredCallback cb)
 Discovers resources of interest by resource type. More...
 
DiscoveryTask::Ptr discoverResourceByTypes (const RCSAddress &address, const std::vector< std::string > &resourceTypes, ResourceDiscoveredCallback cb)
 Discovers resources of interest by resource types. More...
 
DiscoveryTask::Ptr discoverResourceByType (const RCSAddress &address, const std::string &relativeUri, const std::string &resourceType, ResourceDiscoveredCallback cb)
 Discovers resources of interest by a resource type with provided relativeUri. More...
 
DiscoveryTask::Ptr discoverResourceByTypes (const RCSAddress &address, const std::string &relativeUri, const std::vector< std::string > &resourceTypes, ResourceDiscoveredCallback cb)
 Discovers resources of interest by resource types with provided relativeUri. More...
 

Static Public Member Functions

static RCSDiscoveryManagergetInstance ()
 

Detailed Description

This class contains the resource discovery methods.

See Also
RCSRemoteResourceObject

Member Typedef Documentation

Typedef for callback of discoverResource APIs.

See Also
discoverResource

Member Function Documentation

DiscoveryTask::Ptr OIC::Service::RCSDiscoveryManager::discoverResource ( const RCSAddress address,
ResourceDiscoveredCallback  cb 
)

Discovers resources of interest, regardless of uri and resource type.

It will consistently discover resources until the discovery task is canceled.

Parameters
addressA RCSAddress object
cbA callback to obtain discovered resource
Exceptions
InvalidParameterExceptionIf cb is empty.
Note
The callback will be invoked in an internal thread.
DiscoveryTask::Ptr OIC::Service::RCSDiscoveryManager::discoverResource ( const RCSAddress address,
const std::string &  relativeUri,
ResourceDiscoveredCallback  cb 
)

Discovers resources of interest, regardless of resource type.

It will consistently discover resources until the discovery task is canceled.

Parameters
addressA RCSAddress object
relativeUriThe relative uri of resource to be searched
cbA callback to obtain discovered resource
Exceptions
InvalidParameterExceptionIf cb is empty.
Note
The callback will be invoked in an internal thread.
DiscoveryTask::Ptr OIC::Service::RCSDiscoveryManager::discoverResourceByType ( const RCSAddress address,
const std::string &  resourceType,
ResourceDiscoveredCallback  cb 
)

Discovers resources of interest by resource type.

It will consistently discover resources until the discovery task is canceled.

Parameters
addressA RCSAddress object
resourceTypeResource Type
cbA callback to obtain discovered resource
Exceptions
InvalidParameterExceptionIf cb is empty.
Note
The callback will be invoked in an internal thread.
DiscoveryTask::Ptr OIC::Service::RCSDiscoveryManager::discoverResourceByType ( const RCSAddress address,
const std::string &  relativeUri,
const std::string &  resourceType,
ResourceDiscoveredCallback  cb 
)

Discovers resources of interest by a resource type with provided relativeUri.

It will consistently discover resources until the discovery task is canceled.

Parameters
addressA RCSAddress object
relativeUriThe relative uri of resource to be searched
resourceTypeResource Type
cbA callback to obtain discovered resource
Exceptions
InvalidParameterExceptionIf cb is empty.
Note
The callback will be invoked in an internal thread.
DiscoveryTask::Ptr OIC::Service::RCSDiscoveryManager::discoverResourceByTypes ( const RCSAddress address,
const std::vector< std::string > &  resourceTypes,
ResourceDiscoveredCallback  cb 
)

Discovers resources of interest by resource types.

It will consistently discover resources until the discovery task is canceled.

Parameters
addressA RCSAddress object
resourceTypesList of Resource Types
cbA callback to obtain discovered resource
Exceptions
InvalidParameterExceptionIf cb is empty.
RCSBadRequestExceptionIf resourceTypes contain more than one element and any of them is empty.
Note
The callback will be invoked in an internal thread.
If resourceTypes is empty, discovers resource by all resource types.
DiscoveryTask::Ptr OIC::Service::RCSDiscoveryManager::discoverResourceByTypes ( const RCSAddress address,
const std::string &  relativeUri,
const std::vector< std::string > &  resourceTypes,
ResourceDiscoveredCallback  cb 
)

Discovers resources of interest by resource types with provided relativeUri.

It will consistently discover resources until the discovery task is canceled.

Parameters
addressA RCSAddress object
relativeUriThe relative uri of resource to be searched
resourceTypesList of Resource Types
cbA callback to obtain discovered resource
Exceptions
InvalidParameterExceptionIf cb is empty.
RCSBadRequestExceptionIf resourceTypes contain more than one element and any of them is empty.
Note
The callback will be invoked in an internal thread.
If resourceTypes is empty, discovers resource by all resource types.
static RCSDiscoveryManager* OIC::Service::RCSDiscoveryManager::getInstance ( )
static
Returns
RCSDiscoveryManager instance.

The documentation for this class was generated from the following file: