1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
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 ******************************************************************/
22 * @file simulator_client.h
24 * @brief This file provides a class for realizing simulator client functionality.
28 #ifndef SIMULATOR_CLIENT_H_
29 #define SIMULATOR_CLIENT_H_
31 #include "simulator_client_types.h"
32 #include "simulator_remote_resource.h"
33 #include "simulator_exceptions.h"
36 * @class SimulatorClient
37 * @brief This class provides a set of functions for discovering the resources over the network.
44 * API for getting singleton instance of SimulatorClient class.
46 * @return Singleton instance of SimulatorClient class.
49 static SimulatorClient *getInstance(void);
52 * API for discovering all type of resources.
53 * Discovered resources will be notified through the callback set using @callback parameter.
55 * @param callback - Method of type @ResourceFindCallback through which discoverd resources
58 * NOTE: API throws @InvalidArgsException and @SimulatorException.
60 void findResources(ResourceFindCallback callback);
63 * API for discovering resources of a particular resource type.
64 * Discovered resources will be notified through the callback set using @callback parameter.
66 * @param resourceType - Type of resource to be searched for
67 * @param callback - Method of type @ResourceFindCallback through which discoverd resources
70 * NOTE: API throws @InvalidArgsException and @SimulatorException.
72 void findResources(const std::string &resourceType, ResourceFindCallback callback);
75 SimulatorClient() = default;
76 ~SimulatorClient() = default;
77 SimulatorClient(const SimulatorClient &) = delete;
78 SimulatorClient &operator=(const SimulatorClient &) = delete;
79 SimulatorClient(const SimulatorClient &&) = delete;
80 SimulatorClient &operator=(const SimulatorClient && ) = delete;
82 void onResourceFound(std::shared_ptr<OC::OCResource> resource,
83 ResourceFindCallback callback);