OpFlex Framework
1.3.0
|
An internal instance of an object in the managed object store. More...
#include <opflex/modb/mo-internal/ObjectInstance.h>
Public Member Functions | |
ObjectInstance (class_id_t class_id_) | |
Construct an empty object represented the specified class. More... | |
class_id_t | getClassId () const |
Get the class ID for this object instance. More... | |
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. More... | |
bool | unset (prop_id_t prop_id, PropertyInfo::property_type_t type, PropertyInfo::cardinality_t cardinality) |
Unset the given property. More... | |
uint64_t | getUInt64 (prop_id_t prop_id) const |
Get the unsigned 64-bit valued property for prop_name. More... | |
uint64_t | getUInt64 (prop_id_t prop_id, size_t index) const |
For a vector-valued 64-bit unsigned property, get the specified property value at the specified index. More... | |
size_t | getUInt64Size (prop_id_t prop_id) const |
Get the number of unsigned 64-bit values for the specified property. More... | |
int64_t | getInt64 (prop_id_t prop_id) const |
Get the signed 64-bit valued property for prop_name. More... | |
int64_t | getInt64 (prop_id_t prop_id, size_t index) const |
For a vector-valued 64-bit signed property, get the specified property value at the specified index. More... | |
size_t | getInt64Size (prop_id_t prop_id) const |
Get the number of signed 64-bit values for the specified property. More... | |
const std::string & | getString (prop_id_t prop_id) const |
Get the string-valued property for prop_name. More... | |
const std::string & | getString (prop_id_t prop_id, size_t index) const |
For a vector-valued string property, get the specified property value at the specified index. More... | |
size_t | getStringSize (prop_id_t prop_id) const |
Get the number of string values for the specified property. More... | |
reference_t | getReference (prop_id_t prop_id) const |
Get the reference-valued property for prop_name. More... | |
reference_t | getReference (prop_id_t prop_id, size_t index) const |
For a vector-valued reference property, get the specified property value at the specified index. More... | |
size_t | getReferenceSize (prop_id_t prop_id) const |
Get the number of reference values for the specified property. More... | |
const MAC & | getMAC (prop_id_t prop_id) const |
Get the MAC-address-valued property for prop_name. More... | |
const MAC & | getMAC (prop_id_t prop_id, size_t index) const |
For a vector-valued MAC address property, get the specified property value at the specified index. More... | |
size_t | getMACSize (prop_id_t prop_id) const |
Get the number of MAC address values for the specified property. More... | |
void | setUInt64 (prop_id_t prop_id, uint64_t value) |
Set the uint64-valued parameter to the specified value. More... | |
void | setUInt64 (prop_id_t prop_id, const std::vector< uint64_t > &value) |
Set the uint64-vector-valued parameter to the specified value. More... | |
void | setString (prop_id_t prop_id, const std::string &value) |
Set the string-valued parameter to the specified value. More... | |
void | setString (prop_id_t prop_id, const std::vector< std::string > &value) |
Set the string-vector-valued parameter to the specified vector. More... | |
void | setInt64 (prop_id_t prop_id, int64_t value) |
Set the int64-valued parameter to the specified value. More... | |
void | setInt64 (prop_id_t prop_id, const std::vector< int64_t > &value) |
Set the int64-vector-valued parameter to the specified value. More... | |
void | setReference (prop_id_t prop_id, class_id_t class_id, const URI &uri) |
Set the reference-valued parameter to the specified value. More... | |
void | setReference (prop_id_t prop_id, const std::vector< reference_t > &value) |
Set the reference-vector-valued parameter to the specified vector. More... | |
void | setMAC (prop_id_t prop_id, const MAC &value) |
Set the MAC address-valued parameter to the specified value. More... | |
void | setMAC (prop_id_t prop_id, const std::vector< MAC > &value) |
Set the MAC address-vector-valued parameter to the specified value. More... | |
void | addUInt64 (prop_id_t prop_id, uint64_t value) |
Add a value to a the specified unsigned 64-bit vector. More... | |
void | addInt64 (prop_id_t prop_id, int64_t value) |
Add a value to a the specified signed 64-bit vector. More... | |
void | addString (prop_id_t prop_id, const std::string &value) |
Add a value to a the specified string vector. More... | |
void | addReference (prop_id_t prop_id, class_id_t class_id, const URI &uri) |
Add a value to a the specified reference vector. More... | |
void | addMAC (prop_id_t prop_id, const MAC &value) |
Add a value to a the specified MAC address vector. More... | |
Friends | |
bool | operator== (const ObjectInstance &lhs, const ObjectInstance &rhs) |
Check for ObjectInstance equality. | |
bool | operator!= (const ObjectInstance &lhs, const ObjectInstance &rhs) |
Check for ObjectInstance inequality. | |
bool | operator== (const Value &lhs, const Value &rhs) |
bool | operator!= (const Value &lhs, const Value &rhs) |
template<typename T > | |
bool | equal (const Value &lhs, const Value &rhs) |
An internal instance of an object in the managed object store.
While inside the object store, an object instance should never be modified; only const references should be generated. To modify, we atomically update the pointer to point to a modified copy.
|
inline |
Construct an empty object represented the specified class.
class_id_ | the class ID for the object |
void opflex::modb::mointernal::ObjectInstance::addInt64 | ( | prop_id_t | prop_id, |
int64_t | value | ||
) |
Add a value to a the specified signed 64-bit vector.
prop_id | the property ID to set |
value | the value to set |
Add a value to a the specified MAC address vector.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::addReference | ( | prop_id_t | prop_id, |
class_id_t | class_id, | ||
const URI & | uri | ||
) |
Add a value to a the specified reference vector.
prop_id | the property ID to set |
class_id | the class_id of the reference |
uri | the URI of the reference |
void opflex::modb::mointernal::ObjectInstance::addString | ( | prop_id_t | prop_id, |
const std::string & | value | ||
) |
Add a value to a the specified string vector.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::addUInt64 | ( | prop_id_t | prop_id, |
uint64_t | value | ||
) |
Add a value to a the specified unsigned 64-bit vector.
prop_id | the property ID to set |
value | the value to set |
|
inline |
Get the class ID for this object instance.
int64_t opflex::modb::mointernal::ObjectInstance::getInt64 | ( | prop_id_t | prop_id | ) | const |
Get the signed 64-bit valued property for prop_name.
prop_id | the property ID to look up |
std::out_of_range | if no such element is present. |
int64_t opflex::modb::mointernal::ObjectInstance::getInt64 | ( | prop_id_t | prop_id, |
size_t | index | ||
) | const |
For a vector-valued 64-bit signed property, get the specified property value at the specified index.
prop_id | the property ID to look up |
index | the vector index to retrieve |
std::out_of_range | if no such element is present. |
size_t opflex::modb::mointernal::ObjectInstance::getInt64Size | ( | prop_id_t | prop_id | ) | const |
Get the number of signed 64-bit values for the specified property.
prop_id | the property ID to look up |
Get the MAC-address-valued property for prop_name.
prop_id | the property ID to look up |
std::out_of_range | if no such element is present. |
const MAC& opflex::modb::mointernal::ObjectInstance::getMAC | ( | prop_id_t | prop_id, |
size_t | index | ||
) | const |
For a vector-valued MAC address property, get the specified property value at the specified index.
prop_id | the property ID to look up |
index | the vector index to retrieve |
std::out_of_range | if no such element is present. |
size_t opflex::modb::mointernal::ObjectInstance::getMACSize | ( | prop_id_t | prop_id | ) | const |
Get the number of MAC address values for the specified property.
prop_id | the property ID to look up |
reference_t opflex::modb::mointernal::ObjectInstance::getReference | ( | prop_id_t | prop_id | ) | const |
Get the reference-valued property for prop_name.
prop_id | the property ID to look up |
std::out_of_range | if no such element is present. |
reference_t opflex::modb::mointernal::ObjectInstance::getReference | ( | prop_id_t | prop_id, |
size_t | index | ||
) | const |
For a vector-valued reference property, get the specified property value at the specified index.
prop_id | the property ID to look up |
index | the vector index to retrieve |
std::out_of_range | if no such element is present. |
size_t opflex::modb::mointernal::ObjectInstance::getReferenceSize | ( | prop_id_t | prop_id | ) | const |
Get the number of reference values for the specified property.
prop_id | the property ID to look up |
const std::string& opflex::modb::mointernal::ObjectInstance::getString | ( | prop_id_t | prop_id | ) | const |
Get the string-valued property for prop_name.
prop_id | the property ID to look up |
std::out_of_range | if no such element is present. |
const std::string& opflex::modb::mointernal::ObjectInstance::getString | ( | prop_id_t | prop_id, |
size_t | index | ||
) | const |
For a vector-valued string property, get the specified property value at the specified index.
prop_id | the property ID to look up |
index | the vector index to retrieve |
std::out_of_range | if no such element is present. |
size_t opflex::modb::mointernal::ObjectInstance::getStringSize | ( | prop_id_t | prop_id | ) | const |
Get the number of string values for the specified property.
prop_id | the property ID to look up |
uint64_t opflex::modb::mointernal::ObjectInstance::getUInt64 | ( | prop_id_t | prop_id | ) | const |
Get the unsigned 64-bit valued property for prop_name.
prop_id | the property ID to look up |
std::out_of_range | if no such element is present. |
uint64_t opflex::modb::mointernal::ObjectInstance::getUInt64 | ( | prop_id_t | prop_id, |
size_t | index | ||
) | const |
For a vector-valued 64-bit unsigned property, get the specified property value at the specified index.
prop_id | the property ID to look up |
index | the vector index to retrieve |
std::out_of_range | if no such element is present. |
size_t opflex::modb::mointernal::ObjectInstance::getUInt64Size | ( | prop_id_t | prop_id | ) | const |
Get the number of unsigned 64-bit values for the specified property.
prop_id | the property ID to look up |
bool opflex::modb::mointernal::ObjectInstance::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.
If the property is vector-valued, this will return false if the vector is zero length.
prop_id | the property ID to check |
cardinality | the cardinality of the property to check |
type | the type of the property |
void opflex::modb::mointernal::ObjectInstance::setInt64 | ( | prop_id_t | prop_id, |
int64_t | value | ||
) |
Set the int64-valued parameter to the specified value.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::setInt64 | ( | prop_id_t | prop_id, |
const std::vector< int64_t > & | value | ||
) |
Set the int64-vector-valued parameter to the specified value.
prop_id | the property ID to set |
value | the value to set |
Set the MAC address-valued parameter to the specified value.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::setMAC | ( | prop_id_t | prop_id, |
const std::vector< MAC > & | value | ||
) |
Set the MAC address-vector-valued parameter to the specified value.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::setReference | ( | prop_id_t | prop_id, |
class_id_t | class_id, | ||
const URI & | uri | ||
) |
Set the reference-valued parameter to the specified value.
prop_id | the property ID to set |
class_id | the class_id of the reference |
uri | the URI of the reference |
void opflex::modb::mointernal::ObjectInstance::setReference | ( | prop_id_t | prop_id, |
const std::vector< reference_t > & | value | ||
) |
Set the reference-vector-valued parameter to the specified vector.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::setString | ( | prop_id_t | prop_id, |
const std::string & | value | ||
) |
Set the string-valued parameter to the specified value.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::setString | ( | prop_id_t | prop_id, |
const std::vector< std::string > & | value | ||
) |
Set the string-vector-valued parameter to the specified vector.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::setUInt64 | ( | prop_id_t | prop_id, |
uint64_t | value | ||
) |
Set the uint64-valued parameter to the specified value.
prop_id | the property ID to set |
value | the value to set |
void opflex::modb::mointernal::ObjectInstance::setUInt64 | ( | prop_id_t | prop_id, |
const std::vector< uint64_t > & | value | ||
) |
Set the uint64-vector-valued parameter to the specified value.
prop_id | the property ID to set |
value | the value to set |
bool opflex::modb::mointernal::ObjectInstance::unset | ( | prop_id_t | prop_id, |
PropertyInfo::property_type_t | type, | ||
PropertyInfo::cardinality_t | cardinality | ||
) |
Unset the given property.
If its a vector, the vector is emptied. If its a scalar, the scalar is unset.
prop_id | the property ID to reset |
type | the type of the property |
cardinality | the cardinality of the property to unset |