894c8ba0b636fdd8142b724e2d4a3dcd7aac1262
[platform/upstream/iotivity.git] / service / resource-encapsulation / include / RCSRepresentation.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 #ifndef RES_ENCAPSULATION_RCSREPRESENTATION_H_
22 #define RES_ENCAPSULATION_RCSREPRESENTATION_H_
23
24 #include "RCSResourceAttributes.h"
25
26 namespace OC
27 {
28     class OCRepresentation;
29 }
30
31 namespace OIC
32 {
33     namespace Service
34     {
35
36         class RCSRepresentation
37         {
38         public:
39
40             RCSRepresentation();
41
42             explicit RCSRepresentation(const std::string& uri);
43             explicit RCSRepresentation(const RCSResourceAttributes& attrs);
44
45             RCSRepresentation(const std::string& uri, const std::vector< std::string >& interfaces,
46                     const std::vector< std::string >& resourceTypes);
47
48             RCSRepresentation(const std::string& uri, const std::vector< std::string >& interfaces,
49                     const std::vector< std::string >& resourceTypes,
50                     const RCSResourceAttributes& attrs);
51
52             std::string getUri() const;
53
54             void setUri(const std::string& uri);
55             void setUri(std::string&& uri);
56
57             const std::vector< std::string >& getInterfaces() const;
58
59             void addInterface(const std::string& interface);
60             void addInterface(std::string&& interface);
61
62             void clearInterfaces();
63
64             const std::vector< std::string >& getResourceTypes() const;
65
66             void addResourceType(const std::string& resourceType);
67             void addResourceType(std::string&& resourceType);
68
69             void clearResourceTypes();
70
71             const RCSResourceAttributes& getAttributes() const;
72             RCSResourceAttributes& getAttributes();
73
74             void setAttributes(const RCSResourceAttributes& attrs);
75             void setAttributes(RCSResourceAttributes&& attrs);
76
77             const std::vector< RCSRepresentation >& getChildren() const;
78
79             void addChild(const RCSRepresentation&);
80             void addChild(RCSRepresentation&&);
81
82             void setChildren(const std::vector< RCSRepresentation >&);
83             void setChildren(std::vector< RCSRepresentation >&&);
84
85             void clearChildren();
86
87             static RCSRepresentation fromOCRepresentation(const OC::OCRepresentation&);
88
89             static OC::OCRepresentation toOCRepresentation(const RCSRepresentation&);
90             static OC::OCRepresentation toOCRepresentation(RCSRepresentation&&);
91
92         private:
93             std::string m_uri;
94
95             std::vector< std::string > m_interfaces;
96             std::vector< std::string > m_resourceTypes;
97
98             RCSResourceAttributes m_attributes;
99
100             std::vector< RCSRepresentation > m_children;
101         };
102
103     }
104 }
105
106 #endif /* RES_ENCAPSULATION_RCSREPRESENTATION_H_ */