OpFlex Framework  1.3.0
PropertyInfo.h
Go to the documentation of this file.
1 /* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */
6 /*
7  * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
8  *
9  * This program and the accompanying materials are made available under the
10  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
11  * and is available at http://www.eclipse.org/legal/epl-v10.html
12  */
13 
14 #ifndef MODB_PROPERTYINFO_H
15 #define MODB_PROPERTYINFO_H
16 
17 #include <boost/shared_ptr.hpp>
18 #include <boost/unordered_map.hpp>
19 #include <string>
20 
21 #include "opflex/modb/EnumInfo.h"
22 
23 namespace opflex {
24 namespace modb {
25 
36 typedef uint64_t class_id_t;
37 
41 typedef uint64_t prop_id_t;
42 
50 class PropertyInfo {
51 public:
52 
66  S64,
68  U64,
70  MAC,
79  };
80 
89  };
90 
95 
100  PropertyInfo(prop_id_t prop_id,
101  const std::string& property_name,
102  property_type_t type,
103  cardinality_t cardinality);
104 
108  PropertyInfo(prop_id_t prop_id,
109  const std::string& property_name,
110  property_type_t type,
111  cardinality_t cardinality,
112  const EnumInfo& enum_info);
113 
118  PropertyInfo(prop_id_t prop_id,
119  const std::string& property_name,
120  property_type_t type,
121  class_id_t class_id,
122  cardinality_t cardinality);
123 
127  ~PropertyInfo();
128 
132  prop_id_t getId() const { return prop_id; }
133 
137  const std::string& getName() const { return property_name; }
138 
142  const property_type_t getType() const { return prop_type; }
143 
148  const class_id_t getClassId() const { return class_id; }
149 
153  const cardinality_t getCardinality() const { return cardinality; }
154 
158  const EnumInfo& getEnumInfo() const { return enum_info; }
159 
160 private:
164  prop_id_t prop_id;
165 
169  std::string property_name;
170 
174  property_type_t prop_type;
175 
180  class_id_t class_id;
181 
185  cardinality_t cardinality;
186 
190  EnumInfo enum_info;
191 };
192 
193 /* @} metadata */
194 /* @} cpp */
195 
196 } /* namespace modb */
197 } /* namespace opflex */
198 
199 #endif /* MODB_PROPERTYINFO_H */
An 8-bit enum value.
Definition: PropertyInfo.h:72
const EnumInfo & getEnumInfo() const
Get the associated enum info for this property if it is an enum.
Definition: PropertyInfo.h:158
An unsigned 64-bit integer value.
Definition: PropertyInfo.h:68
A scalar-valued property.
Definition: PropertyInfo.h:86
Enum info defines the set of possible values for an enum as well as the properties current defined by...
Definition: EnumInfo.h:41
~PropertyInfo()
Destroy the property info object.
Interface definition file for EnumInfo.
const std::string & getName() const
Get the name for this property.
Definition: PropertyInfo.h:137
const property_type_t getType() const
Get the type of this property.
Definition: PropertyInfo.h:142
cardinality_t
Enum representing the cardinality of the property.
Definition: PropertyInfo.h:84
A composite property.
Definition: PropertyInfo.h:58
A 16-bit enum value.
Definition: PropertyInfo.h:74
const class_id_t getClassId() const
Get the class ID for this property.
Definition: PropertyInfo.h:148
A string-valued property containing a class ID and URI which is a reference to another location in th...
Definition: PropertyInfo.h:62
const cardinality_t getCardinality() const
Get the cardinality for this type.
Definition: PropertyInfo.h:153
uint64_t class_id_t
A unique class ID.
Definition: ofcore_c.h:94
uint64_t class_id_t
A unique class ID.
Definition: PropertyInfo.h:36
A signed 64-bit integer value.
Definition: PropertyInfo.h:66
A 32-bit enum value.
Definition: PropertyInfo.h:76
A vector-valued property.
Definition: PropertyInfo.h:88
A 64-bit enum value.
Definition: PropertyInfo.h:78
uint64_t prop_id_t
A unique property ID.
Definition: PropertyInfo.h:41
Property info provides metadata about a particular managed object property.
Definition: PropertyInfo.h:50
A MAC address.
Definition: PropertyInfo.h:70
property_type_t
Possible property types.
Definition: PropertyInfo.h:56
A string-valued property.
Definition: PropertyInfo.h:64
PropertyInfo()
Default constructor.
Definition: PropertyInfo.h:94
prop_id_t getId() const
Get the id for this property.
Definition: PropertyInfo.h:132