Otawa
0.10
|
A property associates a data with an identifier. More...
#include <otawa/prop/PropList.h>
Public Member Functions | |
Property (const AbstractIdentifier *id) | |
Build a new property with the given identifier. More... | |
Property (const AbstractIdentifier &id) | |
build a property from a static identifier. More... | |
Property (elm::CString name) | |
Build a property with the name of its identifier. More... | |
const AbstractIdentifier * | id (void) const |
Get the identifier code of the property. More... | |
Property * | next (void) const |
Get the next property. More... | |
template<class T > | |
const T & | get (void) const |
template<class T > | |
void | set (const T &value) |
virtual void | print (elm::io::Output &out) const |
Print the given property, that is, the identifier and its value if any. More... | |
Static Public Member Functions | |
static const AbstractIdentifier * | getID (elm::CString name) |
Allocate a new identifier matching the given name. More... | |
Protected Member Functions | |
virtual | ~Property (void) |
Virtual destructor for allowing destruction of any stored data. More... | |
virtual Property * | copy (void) |
This method is called when a property is copied. More... | |
Private Attributes | |
Property * | _next |
const AbstractIdentifier * | _id |
Friends | |
class | PropList |
A property associates a data with an identifier.
They are stored in ProgObject and allow storage and retrieval of any data. For efficiency purpose, they use integer identifier that are associated with string names.
|
inlineprotectedvirtual |
Virtual destructor for allowing destruction of any stored data.
|
inline |
Build a new property with the given identifier.
_id | Identifier of the property. |
Referenced by copy().
|
inline |
build a property from a static identifier.
_id | Property identifier. |
|
inline |
Build a property with the name of its identifier.
name | Name of the identifier. |
|
inlineprotectedvirtual |
This method is called when a property is copied.
It may be specialized by Property class children.
Reimplemented in otawa::LockedProperty< T >, and otawa::GenericProperty< T >.
References _id, and Property().
Referenced by otawa::ContextualProperty::refProps().
|
inline |
|
static |
Allocate a new identifier matching the given name.
Note that, if an identifier exists with the same name, its code will be returned ensuring consistency between name and code for identifiers.
name | Name of the identifier. |
References otawa::display::find().
|
inline |
Get the identifier code of the property.
References _id.
Referenced by otawa::GenericProperty< T >::copy(), otawa::LockedProperty< T >::copy(), otawa::PropList::Iter::operator!=(), otawa::PropList::Iter::operator==(), and otawa::PropList::setProp().
|
inline |
Get the next property.
References _next.
Referenced by otawa::PropList::addProps(), otawa::PropList::clearProps(), otawa::PropList::extractProp(), otawa::PropList::getProp(), otawa::PropList::Iter::next(), otawa::PropList::removeAllProp(), otawa::PropList::removeProp(), and otawa::PropList::setProp().
|
virtual |
Print the given property, that is, the identifier and its value if any.
out | Output to use. |
Referenced by otawa::operator<<().
|
inline |
|
friend |
|
private |
|
mutableprivate |