1 /******************************************************************
\r
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
19 ******************************************************************/
\r
22 * @file Definitions.h
\r
24 * @brief This file provides data Model for Json Schema Definitions.
\r
27 #ifndef DEFINITIONS_H_
\r
28 #define DEFINITIONS_H_
\r
33 #include "Properties.h"
\r
39 * @class Definitions
\r
40 * @brief This class provides data Model for Json Schema Definitions.
\r
47 * Constructor of Definitions.
\r
49 Definitions() = default;
\r
51 * Copy Constructor of Definitions.
\r
53 * @param Definitions
\r
55 Definitions(const Definitions &) = default;
\r
57 * Assignment operator for Definitions.
\r
59 * @param Definitions
\r
61 Definitions &operator=(const Definitions &) = default;
\r
63 * Copy Constructor of Definitions.
\r
65 * @param Definitions
\r
67 Definitions(Definitions &&) = default;
\r
69 * Assignment operator for Definitions.
\r
71 * @param Definitions
\r
73 Definitions &operator=(Definitions &&) = default;
\r
76 * Constructor of Definitions.
\r
78 * @param name - Definitions name as string.
\r
80 Definitions(const std::string &name) : m_defName(name) {}
\r
83 * This method is for getting Name from Definitions.
\r
85 * @return Definitions name as string
\r
87 std::string getName() const;
\r
89 * This method is for setting name to Definitions
\r
91 * @param name - Definitions name as string.
\r
93 void setName(const std::string &name);
\r
96 * This method is for getting Type from Definitions.
\r
98 * @return Definitions Type as string
\r
100 std::string getType() const;
\r
103 * This method is for setting Type to Definitions
\r
105 * @param type - Definitions Type as string.
\r
107 void setType(const std::string &type);
\r
109 * This method is for getting RequiredValue from Definitions.
\r
111 * @return list of RequiredValue as string
\r
113 std::vector<std::string> const &getRequiredValues() const;
\r
116 * This method is for setting RequiredValue to Definitions
\r
118 * @param reqValue - RequiredValue as string.
\r
120 void setRequiredValue(const std::string &reqValue);
\r
123 * This method is for getting size of Properties from Definitions.
\r
125 * @return size of Properties map
\r
127 int propertiesSize() const { return m_properties.size(); }
\r
130 * This method is for getting Properties from Definitions.
\r
132 * @param propName - name of property as string.
\r
134 * @return pointer to Properties.
\r
136 PropertiesPtr getproperty(const std::string &propName );
\r
139 * This method is for getting Properties from Definitions.
\r
141 * @return map of Property name and pointer to Properties
\r
143 std::map<std::string, PropertiesPtr> const &getProperties();
\r
146 * This method is for setting Properties to Definitions
\r
148 * @param propName - Definitions Type as string.
\r
149 * @param property - pointer to Properties.
\r
151 void addProperty(const std::string &propName, const PropertiesPtr &property);
\r
154 std::map<std::string, PropertiesPtr > m_properties;
\r
155 std::string m_defName;
\r
156 std::string m_type;
\r
157 std::vector<std::string> m_required;
\r
161 /** DefinitionsPtr - shared Ptr to Definitions.*/
\r
162 typedef std::shared_ptr<Definitions> DefinitionsPtr;
\r