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/unordered_map.hpp>
22 #include <boost/variant.hpp>
41 typedef std::pair<class_id_t, URI> reference_t;
49 namespace mointernal {
323 const std::vector<reference_t>& value);
403 boost::variant<boost::blank,
409 std::vector<uint64_t>*,
410 std::vector<int64_t>*,
411 std::vector<std::string>*,
412 std::vector<reference_t>*,
413 std::vector<MAC>*> value;
416 Value(
const Value& val);
418 Value& operator=(
const Value& val);
423 typedef boost::unordered_map<prop_key_t, Value> prop_map_t;
434 template <
typename T>
435 friend bool equal(
const Value& lhs,
const Value& rhs);
441 bool operator==(
const ObjectInstance& lhs,
const ObjectInstance& rhs);
445 bool operator!=(
const ObjectInstance& lhs,
const ObjectInstance& rhs);
size_t getStringSize(prop_id_t prop_id) const
Get the number of string values for the specified property.
bool unset(prop_id_t prop_id, PropertyInfo::property_type_t type, PropertyInfo::cardinality_t cardinality)
Unset the given property.
void setInt64(prop_id_t prop_id, int64_t value)
Set the int64-valued parameter to the specified value.
Interface definition file for MACs.
A scalar-valued property.
Definition: PropertyInfo.h:86
void setUInt64(prop_id_t prop_id, uint64_t value)
Set the uint64-valued parameter to the specified value.
size_t getInt64Size(prop_id_t prop_id) const
Get the number of signed 64-bit values for the specified property.
void addUInt64(prop_id_t prop_id, uint64_t value)
Add a value to a the specified unsigned 64-bit vector.
cardinality_t
Enum representing the cardinality of the property.
Definition: PropertyInfo.h:84
int64_t getInt64(prop_id_t prop_id) const
Get the signed 64-bit valued property for prop_name.
void setReference(prop_id_t prop_id, class_id_t class_id, const URI &uri)
Set the reference-valued parameter to the specified value.
Interface definition file for PropertyInfo.
void setMAC(prop_id_t prop_id, const MAC &value)
Set the MAC address-valued parameter to the specified value.
void setString(prop_id_t prop_id, const std::string &value)
Set the string-valued parameter to the specified value.
void addInt64(prop_id_t prop_id, int64_t value)
Add a value to a the specified signed 64-bit vector.
bool isSet(prop_id_t prop_id, PropertyInfo::property_type_t type, PropertyInfo::cardinality_t cardinality=PropertyInfo::SCALAR) const
Check whether the given property is set.
An internal instance of an object in the managed object store.
Definition: ObjectInstance.h:58
size_t getMACSize(prop_id_t prop_id) const
Get the number of MAC address values for the specified property.
ObjectInstance(class_id_t class_id_)
Construct an empty object represented the specified class.
Definition: ObjectInstance.h:65
void addString(prop_id_t prop_id, const std::string &value)
Add a value to a the specified string vector.
size_t getUInt64Size(prop_id_t prop_id) const
Get the number of unsigned 64-bit values for the specified property.
void addReference(prop_id_t prop_id, class_id_t class_id, const URI &uri)
Add a value to a the specified reference vector.
A URI is used to identify managed objects in the MODB.
Definition: URI.h:41
class_id_t getClassId() const
Get the class ID for this object instance.
Definition: ObjectInstance.h:72
const MAC & getMAC(prop_id_t prop_id) const
Get the MAC-address-valued property for prop_name.
size_t getReferenceSize(prop_id_t prop_id) const
Get the number of reference values for the specified property.
Interface definition file for URIs.
void addMAC(prop_id_t prop_id, const MAC &value)
Add a value to a the specified MAC address vector.
const std::string & getString(prop_id_t prop_id) const
Get the string-valued property for prop_name.
property_type_t
Possible property types.
Definition: PropertyInfo.h:56
A MAC address is used to identify devices on an ethernet network.
Definition: MAC.h:40
friend bool operator==(const ObjectInstance &lhs, const ObjectInstance &rhs)
Check for ObjectInstance equality.
uint64_t getUInt64(prop_id_t prop_id) const
Get the unsigned 64-bit valued property for prop_name.
friend bool operator!=(const ObjectInstance &lhs, const ObjectInstance &rhs)
Check for ObjectInstance inequality.
reference_t getReference(prop_id_t prop_id) const
Get the reference-valued property for prop_name.
size_t hash_value(MAC const &mac)
Compute a hash value for the MAC, making MAC suitable as a key in an unordered_map.