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 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef RES_ENCAPSULATION_RCSREPRESENTATION_H_
22 #define RES_ENCAPSULATION_RCSREPRESENTATION_H_
24 #include "RCSResourceAttributes.h"
28 class OCRepresentation;
36 class RCSRepresentation
42 explicit RCSRepresentation(const std::string& uri);
43 explicit RCSRepresentation(const RCSResourceAttributes& attrs);
45 RCSRepresentation(const std::string& uri, const std::vector< std::string >& interfaces,
46 const std::vector< std::string >& resourceTypes);
48 RCSRepresentation(const std::string& uri, const std::vector< std::string >& interfaces,
49 const std::vector< std::string >& resourceTypes,
50 const RCSResourceAttributes& attrs);
52 std::string getUri() const;
54 void setUri(const std::string& uri);
55 void setUri(std::string&& uri);
57 const std::vector< std::string >& getInterfaces() const;
59 void addInterface(const std::string& interface);
60 void addInterface(std::string&& interface);
62 void clearInterfaces();
64 const std::vector< std::string >& getResourceTypes() const;
66 void addResourceType(const std::string& resourceType);
67 void addResourceType(std::string&& resourceType);
69 void clearResourceTypes();
71 const RCSResourceAttributes& getAttributes() const;
72 RCSResourceAttributes& getAttributes();
74 void setAttributes(const RCSResourceAttributes& attrs);
75 void setAttributes(RCSResourceAttributes&& attrs);
77 const std::vector< RCSRepresentation >& getChildren() const;
79 void addChild(const RCSRepresentation&);
80 void addChild(RCSRepresentation&&);
82 void setChildren(const std::vector< RCSRepresentation >&);
83 void setChildren(std::vector< RCSRepresentation >&&);
87 static RCSRepresentation fromOCRepresentation(const OC::OCRepresentation&);
89 static OC::OCRepresentation toOCRepresentation(const RCSRepresentation&);
90 static OC::OCRepresentation toOCRepresentation(RCSRepresentation&&);
95 std::vector< std::string > m_interfaces;
96 std::vector< std::string > m_resourceTypes;
98 RCSResourceAttributes m_attributes;
100 std::vector< RCSRepresentation > m_children;
106 #endif /* RES_ENCAPSULATION_RCSREPRESENTATION_H_ */