OpFlex Framework  1.7.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 <string>
18 
19 #include "opflex/modb/EnumInfo.h"
20 
21 namespace opflex {
22 namespace modb {
23 
34 typedef uint64_t class_id_t;
35 
39 typedef uint64_t prop_id_t;
40 
48 class PropertyInfo {
49 public:
50 
64  S64,
66  U64,
68  MAC,
77  };
78 
87  };
88 
93 
98  PropertyInfo(prop_id_t prop_id,
99  const std::string& property_name,
100  property_type_t type,
101  cardinality_t cardinality);
102 
106  PropertyInfo(prop_id_t prop_id,
107  const std::string& property_name,
108  property_type_t type,
109  cardinality_t cardinality,
110  const EnumInfo& enum_info);
111 
116  PropertyInfo(prop_id_t prop_id,
117  const std::string& property_name,
118  property_type_t type,
119  class_id_t class_id,
120  cardinality_t cardinality);
121 
125  ~PropertyInfo();
126 
130  prop_id_t getId() const { return prop_id; }
131 
135  const std::string& getName() const { return property_name; }
136 
140  const property_type_t getType() const { return prop_type; }
141 
146  const class_id_t getClassId() const { return class_id; }
147 
151  const cardinality_t getCardinality() const { return cardinality; }
152 
156  const EnumInfo& getEnumInfo() const { return enum_info; }
157 
158 private:
162  prop_id_t prop_id;
163 
167  std::string property_name;
168 
172  property_type_t prop_type;
173 
178  class_id_t class_id;
179 
183  cardinality_t cardinality;
184 
188  EnumInfo enum_info;
189 };
190 
191 /* @} metadata */
192 /* @} cpp */
193 
194 } /* namespace modb */
195 } /* namespace opflex */
196 
197 #endif /* MODB_PROPERTYINFO_H */
An 8-bit enum value.
Definition: PropertyInfo.h:70
const EnumInfo & getEnumInfo() const
Get the associated enum info for this property if it is an enum.
Definition: PropertyInfo.h:156
An unsigned 64-bit integer value.
Definition: PropertyInfo.h:66
A scalar-valued property.
Definition: PropertyInfo.h:84
Enum info defines the set of possible values for an enum as well as the properties current defined by...
Definition: EnumInfo.h:40
~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:135
const property_type_t getType() const
Get the type of this property.
Definition: PropertyInfo.h:140
cardinality_t
Enum representing the cardinality of the property.
Definition: PropertyInfo.h:82
A composite property.
Definition: PropertyInfo.h:56
A 16-bit enum value.
Definition: PropertyInfo.h:72
const class_id_t getClassId() const
Get the class ID for this property.
Definition: PropertyInfo.h:146
A string-valued property containing a class ID and URI which is a reference to another location in th...
Definition: PropertyInfo.h:60
const cardinality_t getCardinality() const
Get the cardinality for this type.
Definition: PropertyInfo.h:151
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:34
A signed 64-bit integer value.
Definition: PropertyInfo.h:64
A 32-bit enum value.
Definition: PropertyInfo.h:74
A vector-valued property.
Definition: PropertyInfo.h:86
A 64-bit enum value.
Definition: PropertyInfo.h:76
uint64_t prop_id_t
A unique property ID.
Definition: PropertyInfo.h:39
Property info provides metadata about a particular managed object property.
Definition: PropertyInfo.h:48
A MAC address.
Definition: PropertyInfo.h:68
property_type_t
Possible property types.
Definition: PropertyInfo.h:54
A string-valued property.
Definition: PropertyInfo.h:62
PropertyInfo()
Default constructor.
Definition: PropertyInfo.h:92
prop_id_t getId() const
Get the id for this property.
Definition: PropertyInfo.h:130