|
OpFlex Framework
1.7.0
|
Types for accessing and working with managed objects. More...
Classes | |
| class | opflex::modb::MAC |
| A MAC address is used to identify devices on an ethernet network. More... | |
| class | opflex::modb::Mutator |
| A mutator represents a set of changes to apply to the data store. More... | |
| class | opflex::modb::ObjectListener |
| Interface for an object interested in updates to objects in the data store. More... | |
| class | opflex::modb::URI |
| A URI is used to identify managed objects in the MODB. More... | |
| class | opflex::modb::URIBuilder |
| Build a URI using path elements from the root of the tree. More... | |
Functions | |
| opflex::modb::MAC::MAC () | |
| Construct a MAC consisting of all zeroes. | |
| opflex::modb::MAC::MAC (const std::string &mac) | |
| Construct a MAC using the given string representation. More... | |
| opflex::modb::MAC::MAC (uint8_t mac[6]) | |
| Construct a MAC using an array of 6 bytes, in network byte order. More... | |
| opflex::modb::MAC::~MAC () | |
| Destroy the MAC. | |
| std::string | opflex::modb::MAC::toString () const |
| Get the MAC represented as a string. | |
| void | opflex::modb::MAC::toUIntArray (uint8_t mac[6]) const |
| Get the MAC represented as an array of 6 bytes in network byte order. | |
| std::ostream & | opflex::modb::operator<< (std::ostream &os, const MAC &mac) |
| Stream insertion operator. | |
| bool | opflex::modb::operator== (const MAC &lhs, const MAC &rhs) |
| Check for MAC equality. | |
| bool | opflex::modb::operator!= (const MAC &lhs, const MAC &rhs) |
| Check for MAC inequality. | |
| size_t | opflex::modb::hash_value (MAC const &mac) |
| Compute a hash value for the MAC, making MAC suitable as a key in a boost::unordered_map. | |
| opflex::modb::Mutator::Mutator (const std::string &owner) | |
| Create a mutator that will work with the default framework instance and owner. More... | |
| opflex::modb::Mutator::Mutator (ofcore::OFFramework &framework, const std::string &owner) | |
| Create a mutator that will work with the provided framework instance and owner. More... | |
| opflex::modb::Mutator::~Mutator () | |
| Destroy the Mutator. More... | |
| void | opflex::modb::Mutator::commit () |
| Commit the changes stored in the mutator to the object store. More... | |
| OF_SHARED_PTR< mointernal::ObjectInstance > & | opflex::modb::Mutator::modify (class_id_t class_id, const URI &uri) |
| Create a new mutable object with the given URI which is a copy of any existing object with the specified URI. More... | |
| void | opflex::modb::Mutator::remove (class_id_t class_id, const URI &uri) |
| Delete the child object specified along with its link to its parents. More... | |
| OF_SHARED_PTR< mointernal ::ObjectInstance > & | opflex::modb::Mutator::addChild (class_id_t parent_class, const URI &parent_uri, prop_id_t parent_prop, class_id_t child_class, const URI &child_uri) |
| Create a new child object with the specified class and URI, and make it a child of the given parent. More... | |
| virtual | opflex::modb::ObjectListener::~ObjectListener () |
| Destroy the object listener. | |
| virtual void | opflex::modb::ObjectListener::objectUpdated (class_id_t class_id, const URI &uri)=0 |
| The specified URI has been added, updated, or deleted. More... | |
| opflex::modb::URI::URI (const OF_SHARED_PTR< const std::string > &uri) | |
| Construct a URI using the given string representation. | |
| opflex::modb::URI::URI (const std::string &uri) | |
| Construct a URI using the given string representation. | |
| opflex::modb::URI::URI (const URI &uri) | |
| Construct a deep copy of the URI using the given URI. | |
| opflex::modb::URI::~URI () | |
| Destroy the URI. | |
| const std::string & | opflex::modb::URI::toString () const |
| Get the URI represented as a string. | |
| void | opflex::modb::URI::getElements (std::vector< std::string > &elements) const |
| Parse the URI and get the unescaped path elements from the URI. More... | |
| URI & | opflex::modb::URI::operator= (const URI &rhs) |
| Assignment operator. | |
| std::ostream & | opflex::modb::operator<< (std::ostream &os, const URI &uri) |
| URI stream insertion. | |
| bool | opflex::modb::operator== (const URI &lhs, const URI &rhs) |
| Check for URI equality. | |
| bool | opflex::modb::operator!= (const URI &lhs, const URI &rhs) |
| Check for URI inequality. | |
| bool | opflex::modb::operator< (const URI &lhs, const URI &rhs) |
| Comparison operator for sorting. | |
| size_t | opflex::modb::hash_value (URI const &uri) |
| Compute a hash value for the URI, making URI suitable as a key in a boost::unordered_map. | |
| opflex::modb::URIBuilder::URIBuilder () | |
| Construct an empty URI builder representing the root element. | |
| opflex::modb::URIBuilder::URIBuilder (const URI &uri) | |
| Construct a URI builder that will append URI elements to the specified URI. More... | |
| opflex::modb::URIBuilder::~URIBuilder () | |
| Destroy the URI Builder. | |
| URIBuilder & | opflex::modb::URIBuilder::addElement (const std::string &elementValue) |
| Add a string-valued path element to the URI path, and URI-escape the value. More... | |
| URIBuilder & | opflex::modb::URIBuilder::addElement (uint32_t elementValue) |
| Add an unsigned int-valued path element to the URI path. More... | |
| URIBuilder & | opflex::modb::URIBuilder::addElement (int32_t elementValue) |
| Add a signed int-valued path element to the URI path. More... | |
| URIBuilder & | opflex::modb::URIBuilder::addElement (uint64_t elementValue) |
| Add an unsigned int-valued path element to the URI path. More... | |
| URIBuilder & | opflex::modb::URIBuilder::addElement (int64_t elementValue) |
| Add a signed int-valued path element to the URI path. More... | |
| URIBuilder & | opflex::modb::URIBuilder::addElement (const MAC &elementValue) |
| Add a mac-address-valued path element to the URI path. More... | |
| URIBuilder & | opflex::modb::URIBuilder::addElement (const URI &elementValue) |
| Add a URI path element to the URI path. More... | |
| URI | opflex::modb::URIBuilder::build () |
| Build the URI from the path elements and return it. | |
Variables | |
| static const URI | opflex::modb::URI::ROOT |
| Static root URI. | |
Friends | |
| class | opflex::modb::Mutator::MutatorImpl |
| class | opflex::modb::URIBuilder::URIBuilderImpl |
| bool | opflex::modb::MAC::operator== (const MAC &lhs, const MAC &rhs) |
| Check for MAC equality. | |
| bool | opflex::modb::MAC::operator!= (const MAC &lhs, const MAC &rhs) |
| Check for MAC inequality. | |
| size_t | opflex::modb::MAC::hash_value (MAC const &mac) |
| Compute a hash value for the MAC, making MAC suitable as a key in a boost::unordered_map. | |
| bool | opflex::modb::URI::operator== (const URI &lhs, const URI &rhs) |
| Check for URI equality. | |
| bool | opflex::modb::URI::operator!= (const URI &lhs, const URI &rhs) |
| Check for URI inequality. | |
| bool | opflex::modb::URI::operator< (const URI &lhs, const URI &rhs) |
| Comparison operator for sorting. | |
| size_t | opflex::modb::URI::hash_value (URI const &uri) |
| Compute a hash value for the URI, making URI suitable as a key in a boost::unordered_map. | |
Types for accessing and working with managed objects.
| OF_SHARED_PTR<mointernal ::ObjectInstance>& opflex::modb::Mutator::addChild | ( | class_id_t | parent_class, |
| const URI & | parent_uri, | ||
| prop_id_t | parent_prop, | ||
| class_id_t | child_class, | ||
| const URI & | child_uri | ||
| ) |
Create a new child object with the specified class and URI, and make it a child of the given parent.
If the object already exists, get a mutable copy of that object.
| URIBuilder& opflex::modb::URIBuilder::addElement | ( | const MAC & | elementValue | ) |
Add a mac-address-valued path element to the URI path.
| elementValue | the value of the element |
| URIBuilder& opflex::modb::URIBuilder::addElement | ( | const std::string & | elementValue | ) |
Add a string-valued path element to the URI path, and URI-escape the value.
| elementValue | the value of the element |
| URIBuilder& opflex::modb::URIBuilder::addElement | ( | const URI & | elementValue | ) |
| URIBuilder& opflex::modb::URIBuilder::addElement | ( | int32_t | elementValue | ) |
Add a signed int-valued path element to the URI path.
| elementValue | the value of the element |
| URIBuilder& opflex::modb::URIBuilder::addElement | ( | int64_t | elementValue | ) |
Add a signed int-valued path element to the URI path.
| elementValue | the value of the element |
| URIBuilder& opflex::modb::URIBuilder::addElement | ( | uint32_t | elementValue | ) |
Add an unsigned int-valued path element to the URI path.
| elementValue | the value of the element |
| URIBuilder& opflex::modb::URIBuilder::addElement | ( | uint64_t | elementValue | ) |
Add an unsigned int-valued path element to the URI path.
| elementValue | the value of the element |
| void opflex::modb::Mutator::commit | ( | ) |
Commit the changes stored in the mutator to the object store.
If this method is not called, these changes will simply be lost. After you call commit(), you can continue to make changes using the same mutator which will be effectively a new "transaction".
| void opflex::modb::URI::getElements | ( | std::vector< std::string > & | elements | ) | const |
|
explicit |
|
explicit |
Construct a MAC using an array of 6 bytes, in network byte order.
| mac | the mac represented as an array of 6 bytes |
| OF_SHARED_PTR<mointernal::ObjectInstance>& opflex::modb::Mutator::modify | ( | class_id_t | class_id, |
| const URI & | uri | ||
| ) |
Create a new mutable object with the given URI which is a copy of any existing object with the specified URI.
| class_id | the class ID for the object |
| uri | The URI for the object |
Referenced by opflex::modb::mointernal::MO::createRootElement().
| opflex::modb::Mutator::Mutator | ( | const std::string & | owner | ) |
Create a mutator that will work with the default framework instance and owner.
| owner | the owner string that will control which fields can be modified. |
| opflex::modb::Mutator::Mutator | ( | ofcore::OFFramework & | framework, |
| const std::string & | owner | ||
| ) |
Create a mutator that will work with the provided framework instance and owner.
| framework | the framework instance that will be modified |
| owner | the owner string that will control which fields can be modified. |
|
pure virtual |
The specified URI has been added, updated, or deleted.
The listener should queue a task to read the new state and perform appropriate processing. If this function blocks or peforms a long-running operation, then the dispatching of update notifications will be stalled, but there will not be any other deleterious effects.
If multiple changes happen to the same URI, then at least one notification will be delivered but some events may be consolidated.
| class_id | the class ID for the type associated with the updated object. |
| uri | the URI for the updated object |
| void opflex::modb::Mutator::remove | ( | class_id_t | class_id, |
| const URI & | uri | ||
| ) |
Delete the child object specified along with its link to its parents.
If the child object has any children that are not removed, then they will be garbage-collected at some later time.
| class_id | the class ID for the object |
| uri | the URI to remove |
Referenced by opflex::modb::mointernal::MO::remove().
| opflex::modb::URIBuilder::URIBuilder | ( | const URI & | uri | ) |
| opflex::modb::Mutator::~Mutator | ( | ) |
Destroy the Mutator.
Any uncommitted changes will be lost.