Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / service / simulator / inc / simulator_collection_resource.h
1 /******************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  ******************************************************************/
20
21 /**
22  * @file   simulator_collection_resource.h
23  *
24  * @brief   This file provides a class and API to access simulated collection resource.
25  */
26
27 #ifndef SIMULATOR_COLLECTION_RESOURCE_H_
28 #define SIMULATOR_COLLECTION_RESOURCE_H_
29
30 #include "simulator_resource.h"
31
32 /**
33  * @class   SimulatorCollectionResource
34  * @brief   This class provides a set of APIs for handling simulated collection resource.
35  */
36 class SimulatorCollectionResource : public SimulatorResource
37 {
38     public:
39
40         /**
41          * API to get list of resources types which collection supports.
42          *
43          * @return List of supported resources types.
44          */
45         virtual std::vector<std::string> getSupportedResources() = 0;
46
47         /**
48          * API to add a child resource to collection.
49          *
50          * @param resource - SimulatorResource shared object.
51          */
52         virtual void addChildResource(const std::shared_ptr<SimulatorResource> &resource) = 0;
53
54         /**
55          * API to remove a child resource from collection.
56          *
57          * @param resource - SimulatorResource shared object.
58          */
59         virtual void removeChildResource(const std::shared_ptr<SimulatorResource> &resource) = 0;
60
61         /**
62          * API to remove a child resource from collection.
63          *
64          * @param uri - URI of child resource to be removed.
65          */
66         virtual void removeChildResource(const std::string &uri) = 0;
67
68         /**
69          * API to get child resources of collection.
70          *
71          * @return List of child resources of collection.
72          */
73         virtual std::vector<SimulatorResourceSP> getChildResources() = 0;
74 };
75
76 typedef std::shared_ptr<SimulatorCollectionResource> SimulatorCollectionResourceSP;
77
78 #endif