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,
76  ENUM64
77  };
78 
86  VECTOR
87  };
88 
93 
99  const std::string& property_name,
100  property_type_t type,
101  cardinality_t cardinality);
102 
107  const std::string& property_name,
108  property_type_t type,
109  cardinality_t cardinality,
110  const EnumInfo& enum_info);
111 
117  const std::string& property_name,
118  property_type_t type,
119  class_id_t class_id,
120  cardinality_t cardinality);
121 
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 */
Interface definition file for EnumInfo.
Enum info defines the set of possible values for an enum as well as the properties current defined by...
Definition: EnumInfo.h:40
Property info provides metadata about a particular managed object property.
Definition: PropertyInfo.h:48
uint64_t class_id_t
A unique class ID.
Definition: ofcore_c.h:94
const std::string & getName() const
Get the name for this property.
Definition: PropertyInfo.h:135
const EnumInfo & getEnumInfo() const
Get the associated enum info for this property if it is an enum.
Definition: PropertyInfo.h:156
PropertyInfo(prop_id_t prop_id, const std::string &property_name, property_type_t type, cardinality_t cardinality)
Construct a property info object with the provided property name and primitive property type.
~PropertyInfo()
Destroy the property info object.
PropertyInfo(prop_id_t prop_id, const std::string &property_name, property_type_t type, cardinality_t cardinality, const EnumInfo &enum_info)
Construct a property info object with enum info of the specified type.
const property_type_t getType() const
Get the type of this property.
Definition: PropertyInfo.h:140
uint64_t prop_id_t
A unique property ID.
Definition: PropertyInfo.h:39
uint64_t class_id_t
A unique class ID.
Definition: PropertyInfo.h:34
PropertyInfo()
Default constructor.
Definition: PropertyInfo.h:92
property_type_t
Possible property types.
Definition: PropertyInfo.h:54
prop_id_t getId() const
Get the id for this property.
Definition: PropertyInfo.h:130
const cardinality_t getCardinality() const
Get the cardinality for this type.
Definition: PropertyInfo.h:151
PropertyInfo(prop_id_t prop_id, const std::string &property_name, property_type_t type, class_id_t class_id, cardinality_t cardinality)
Construct a property info object with either a composite or reference data type of the specified type...
cardinality_t
Enum representing the cardinality of the property.
Definition: PropertyInfo.h:82
const class_id_t getClassId() const
Get the class ID for this property.
Definition: PropertyInfo.h:146
@ ENUM8
An 8-bit enum value.
Definition: PropertyInfo.h:70
@ REFERENCE
A string-valued property containing a class ID and URI which is a reference to another location in th...
Definition: PropertyInfo.h:60
@ STRING
A string-valued property.
Definition: PropertyInfo.h:62
@ S64
A signed 64-bit integer value.
Definition: PropertyInfo.h:64
@ MAC
A MAC address.
Definition: PropertyInfo.h:68
@ ENUM16
A 16-bit enum value.
Definition: PropertyInfo.h:72
@ ENUM64
A 64-bit enum value.
Definition: PropertyInfo.h:76
@ ENUM32
A 32-bit enum value.
Definition: PropertyInfo.h:74
@ U64
An unsigned 64-bit integer value.
Definition: PropertyInfo.h:66
@ COMPOSITE
A composite property.
Definition: PropertyInfo.h:56
@ VECTOR
A vector-valued property.
Definition: PropertyInfo.h:86
@ SCALAR
A scalar-valued property.
Definition: PropertyInfo.h:84