OpFlex Framework  1.7.0
opflex::modb::ClassInfo Class Reference

Class info provides metadata about managed object classes and properties. More...

#include <opflex/modb/ClassInfo.h>

Public Types

enum  class_type_t {
  POLICY, REMOTE_ENDPOINT, LOCAL_ENDPOINT, OBSERVABLE,
  LOCAL_ONLY, RESOLVER, RELATIONSHIP, REVERSE_RELATIONSHIP
}
 The type of an MO in the Opflex protocol. More...
 
typedef OF_UNORDERED_MAP
< prop_id_t, PropertyInfo
property_map_t
 A map from a prop_id_t to a PropertyInfo object.
 

Public Member Functions

 ClassInfo ()
 Default constructor.
 
 ClassInfo (class_id_t class_id, class_type_t class_type, const std::string &class_name, const std::string &owner, const std::vector< PropertyInfo > &properties, const std::vector< prop_id_t > &naming_props)
 Construct a class info object for the given class ID.
 
 ~ClassInfo ()
 Destroy the class index.
 
const std::string & getName () const
 Get the name for this class. More...
 
const std::string & getOwner () const
 Get the owner for this class. More...
 
class_id_t getId () const
 Get the unique class ID for this class. More...
 
class_type_t getType () const
 Get the type of this class. More...
 
const property_map_tgetProperties () const
 Get the properties that exist for this class. More...
 
const std::vector< prop_id_t > & getNamingProps () const
 Get the vector of naming properties (in order) that make up the key or naming properties for this class. More...
 
const PropertyInfogetProperty (const std::string &name) const
 Get the PropertyInfo for the given named property. More...
 
const PropertyInfogetProperty (prop_id_t &prop_id) const
 Get the PropertyInfo for the given property ID. More...
 

Detailed Description

Class info provides metadata about managed object classes and properties.

This metadata is generated by the code generation framework and is required when the framework is initialized.

Member Enumeration Documentation

The type of an MO in the Opflex protocol.

Updates to these MOs will trigger different operations depending on their types.

Enumerator
POLICY 

An MO describing a configured policy that describes some user intent.

These objects are owned by the policy repository.

REMOTE_ENDPOINT 

An MO describing a policy enforcement endpoint that resolved from the endpoint registry.

These objects are owned by the endpoint registry and ultimately the remote policy element.

LOCAL_ENDPOINT 

An MO describing a policy enforcement endpoint that must be registered in the endpoint registry.

These objects are owned and maintained by the local policy element.

OBSERVABLE 

An MO containing information that is reported to the observer.

This could include health information, faults and other status, and statistics related to its parent MO.

LOCAL_ONLY 

An MO that exists only locally and will not be transmitted over the OpFlex protocol.

RESOLVER 

A special managed object that will be created by the framework and will contain state about pending managed object resolutions.

RELATIONSHIP 

A type that represents a relationship between two managed objects.

This type would contain a target reference property that will allow the user to resolve related managed objects.

REVERSE_RELATIONSHIP 

A reverse relationship works just like a relationship except that it represents the reverse direction.

Though a reverse relationship contains a reference to the referring object, this reference will not be automatically resolved.

Member Function Documentation

class_id_t opflex::modb::ClassInfo::getId ( ) const
inline

Get the unique class ID for this class.

Returns
the class ID
const std::string& opflex::modb::ClassInfo::getName ( ) const
inline

Get the name for this class.

Returns
the name
const std::vector<prop_id_t>& opflex::modb::ClassInfo::getNamingProps ( ) const
inline

Get the vector of naming properties (in order) that make up the key or naming properties for this class.

Returns
a vector of property ID object.
const std::string& opflex::modb::ClassInfo::getOwner ( ) const
inline

Get the owner for this class.

Returns
the owner string
const property_map_t& opflex::modb::ClassInfo::getProperties ( ) const
inline

Get the properties that exist for this class.

Returns
A map from prop_id_t to PropertyInfo
const PropertyInfo& opflex::modb::ClassInfo::getProperty ( const std::string &  name) const
inline

Get the PropertyInfo for the given named property.

Parameters
namethe name of the property
Returns
a reference to the property info
Exceptions
std::out_of_rangeif there is no property with that name
const PropertyInfo& opflex::modb::ClassInfo::getProperty ( prop_id_t prop_id) const
inline

Get the PropertyInfo for the given property ID.

Parameters
prop_idthe ID of the property
Returns
a reference to the property info
Exceptions
std::out_of_rangeif there is no property with that ID
class_type_t opflex::modb::ClassInfo::getType ( ) const
inline

Get the type of this class.

Returns
the class type
See Also
class_type_t

The documentation for this class was generated from the following file: