IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RCSRepresentation.h
Go to the documentation of this file.
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 
43  {
44  public:
46 
47  explicit RCSRepresentation(const std::string& uri);
48  explicit RCSRepresentation(const RCSResourceAttributes& attrs);
49 
50  RCSRepresentation(const std::string& uri, const std::vector< std::string >& interfaces,
51  const std::vector< std::string >& resourceTypes);
52 
53  RCSRepresentation(const std::string& uri, const std::vector< std::string >& interfaces,
54  const std::vector< std::string >& resourceTypes,
55  const RCSResourceAttributes& attrs);
56 
60  std::string getUri() const;
61 
65  void setUri(std::string uri);
66 
70  const std::vector< std::string >& getInterfaces() const;
71 
77  void addInterface(std::string interface);
78 
82  void clearInterfaces();
83 
87  const std::vector< std::string >& getResourceTypes() const;
88 
89 
93  void addResourceType(std::string resourceType);
94 
98  void clearResourceTypes();
99 
103  const RCSResourceAttributes& getAttributes() const;
104 
109 
115  void setAttributes(const RCSResourceAttributes& attrs);
116 
120  void setAttributes(RCSResourceAttributes&& attrs);
121 
125  const std::vector< RCSRepresentation >& getChildren() const;
126 
132  void addChild(RCSRepresentation child);
133 
139  void setChildren(std::vector< RCSRepresentation > children);
140 
144  void clearChildren();
145 
152 
153 
161 
162  private:
163  std::string m_uri;
164 
165  std::vector< std::string > m_interfaces;
166  std::vector< std::string > m_resourceTypes;
167 
168  RCSResourceAttributes m_attributes;
169 
170  std::vector< RCSRepresentation > m_children;
171  };
172 
173  }
174 }
175 
176 #endif /* RES_ENCAPSULATION_RCSREPRESENTATION_H_ */
const std::vector< RCSRepresentation > & getChildren() const
Returns children of this representation.
const std::vector< std::string > & getResourceTypes() const
Returns all resource types added.
static RCSRepresentation fromOCRepresentation(const OC::OCRepresentation &)
Converts OCRepresentation into RCSRepresentation.
void addResourceType(std::string resourceType)
Adds a resource type.
This file contains the declaration of classes and its members related to RCSResourceAttributes.
This class describes a resource representation.
Definition: RCSRepresentation.h:42
void addChild(RCSRepresentation child)
Adds a child to this representation.
void setUri(std::string uri)
Sets the uri of this representation.
void setChildren(std::vector< RCSRepresentation > children)
Sets children of this representation.
const RCSResourceAttributes & getAttributes() const
Returns attributes set in this representation.
This represents the attributes for a resource.
Definition: RCSResourceAttributes.h:195
void clearChildren()
Removse all children.
void clearResourceTypes()
Removes all resource types.
const std::vector< std::string > & getInterfaces() const
Returns all interfaces added.
static OC::OCRepresentation toOCRepresentation(const RCSRepresentation &)
Converts RCSRepresentation into OCRepresentation.
void setAttributes(const RCSResourceAttributes &attrs)
Overwrite attributes.
void addInterface(std::string interface)
Adds an interface.
void clearInterfaces()
Removes all interfaces added.
std::string getUri() const
Returns the uri.
Definition: OCRepresentation.h:84