1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 * This file contains the RCSDiscoveryManager class which provide API to discover the Resource in the network
28 #ifndef RCSDISCOVERYMANAGER_H
29 #define RCSDISCOVERYMANAGER_H
39 class RCSRemoteResourceObject;
43 * This class contains the resource discovery method.
45 * @see RCSRemoteResourceObject
47 class RCSDiscoveryManager
52 * Typedef for callback of discoverResource API
54 * @see discoverResource
56 typedef std::function< void(std::shared_ptr< RCSRemoteResourceObject >) >
57 ResourceDiscoveredCallback;
60 * Returns RCSDiscoveryManager instance.
63 static RCSDiscoveryManager* getInstance();
66 * API for discovering the resource of Interest.
68 * @param address A RCSAddress object
69 * @param resourceURI The uri of resource to be searched
70 * @param cb A callback to obtain discovered resource
72 * @throws InvalidParameterException If cb is empty.
74 * @note The callback will be invoked in an internal thread.
79 void discoverResource(const RCSAddress& address, const std::string& resourceURI,
80 ResourceDiscoveredCallback cb);
83 RCSDiscoveryManager() = default;
84 ~RCSDiscoveryManager() = default;
89 #endif // RCSDISCOVERYMANAGER_H