14 #ifndef MODB_OBJECTINSTANCE_H_ 15 #define MODB_OBJECTINSTANCE_H_ 19 #include <boost/tuple/tuple_comparison.hpp> 20 #include <boost/cstdint.hpp> 21 #include <boost/variant.hpp> 26 #include "opflex/ofcore/OFTypes.h" 58 #if __cplusplus > 199711L 94 namespace mointernal {
152 uint64_t getUInt64(
prop_id_t prop_id)
const;
163 uint64_t getUInt64(
prop_id_t prop_id,
size_t index)
const;
172 size_t getUInt64Size(
prop_id_t prop_id)
const;
181 int64_t getInt64(
prop_id_t prop_id)
const;
192 int64_t getInt64(
prop_id_t prop_id,
size_t index)
const;
201 size_t getInt64Size(
prop_id_t prop_id)
const;
209 const std::string& getString(
prop_id_t prop_id)
const;
220 const std::string& getString(
prop_id_t prop_id,
size_t index)
const;
228 size_t getStringSize(
prop_id_t prop_id)
const;
255 size_t getReferenceSize(
prop_id_t prop_id)
const;
275 const MAC& getMAC(
prop_id_t prop_id,
size_t index)
const;
284 size_t getMACSize(
prop_id_t prop_id)
const;
294 void setUInt64(
prop_id_t prop_id, uint64_t value);
304 void setUInt64(
prop_id_t prop_id,
const std::vector<uint64_t>& value);
314 void setString(
prop_id_t prop_id,
const std::string& value);
324 void setString(
prop_id_t prop_id,
const std::vector<std::string>& value);
334 void setInt64(
prop_id_t prop_id, int64_t value);
344 void setInt64(
prop_id_t prop_id,
const std::vector<int64_t>& value);
368 const std::vector<reference_t>& value);
388 void setMAC(
prop_id_t prop_id,
const std::vector<MAC>& value);
398 void addUInt64(
prop_id_t prop_id, uint64_t value);
408 void addInt64(
prop_id_t prop_id, int64_t value);
418 void addString(
prop_id_t prop_id,
const std::string& value);
448 boost::variant<boost::blank,
454 std::vector<uint64_t>*,
455 std::vector<int64_t>*,
456 std::vector<std::string>*,
457 std::vector<reference_t>*,
458 std::vector<MAC>*> value;
461 Value(
const Value& val);
463 Value& operator=(
const Value& val);
468 typedef OF_UNORDERED_MAP<prop_key_t, Value> prop_map_t;
475 friend bool operator==(
const Value& lhs,
477 friend bool operator!=(
const Value& lhs,
479 template <
typename T>
480 friend bool equal(
const Value& lhs,
const Value& rhs);
boost::tuple< PropertyInfo::property_type_t, PropertyInfo::cardinality_t, prop_id_t > prop_key_t
A tuple containing the key for a property value.
Definition: ObjectInstance.h:36
bool operator==(const MAC &lhs, const MAC &rhs)
Check for MAC equality.
Interface definition file for MACs.
A scalar-valued property.
Definition: PropertyInfo.h:84
cardinality_t
Enum representing the cardinality of the property.
Definition: PropertyInfo.h:82
size_t hash_value(URI const &uri)
Compute a hash value for the URI, making URI suitable as a key in a boost::unordered_map.
Interface definition file for PropertyInfo.
An internal instance of an object in the managed object store.
Definition: ObjectInstance.h:103
class_id_t getClassId() const
Get the class ID for this object instance.
Definition: ObjectInstance.h:117
Definition: OFLogHandler.h:20
ObjectInstance(class_id_t class_id_)
Construct an empty object represented the specified class.
Definition: ObjectInstance.h:110
bool operator!=(const MAC &lhs, const MAC &rhs)
Check for MAC inequality.
std::pair< class_id_t, URI > reference_t
A URI reference containing a class ID and a URI pair.
Definition: ObjectInstance.h:41
A URI is used to identify managed objects in the MODB.
Definition: URI.h:43
Interface definition file for URIs.
property_type_t
Possible property types.
Definition: PropertyInfo.h:54
A MAC address is used to identify devices on an ethernet network.
Definition: MAC.h:37
size_t hash_value(MAC const &mac)
Compute a hash value for the MAC, making MAC suitable as a key in a boost::unordered_map.