Otawa  0.10
otawa::Property Class Reference

A property associates a data with an identifier. More...

#include <otawa/prop/PropList.h>

Inheritance diagram for otawa::Property:
otawa::ContextualProperty otawa::GenericProperty< T > otawa::DeletableProperty< T > otawa::LockedProperty< T >

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 AbstractIdentifierid (void) const
 Get the identifier code of the property. More...
 
Propertynext (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 AbstractIdentifiergetID (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 Propertycopy (void)
 This method is called when a property is copied. More...
 

Private Attributes

Property_next
 
const AbstractIdentifier_id
 

Friends

class PropList
 

Detailed Description

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.

Constructor & Destructor Documentation

otawa::Property::~Property ( void  )
inlineprotectedvirtual

Virtual destructor for allowing destruction of any stored data.

otawa::Property::Property ( const AbstractIdentifier _id)
inline

Build a new property with the given identifier.

Parameters
_idIdentifier of the property.

Referenced by copy().

otawa::Property::Property ( const AbstractIdentifier _id)
inline

build a property from a static identifier.

Parameters
_idProperty identifier.
otawa::Property::Property ( elm::CString  name)
inline

Build a property with the name of its identifier.

Parameters
nameName of the identifier.

Member Function Documentation

Property * otawa::Property::copy ( void  )
inlineprotectedvirtual

This method is called when a property is copied.

It may be specialized by Property class children.

Returns
Copy of the current property.

Reimplemented in otawa::LockedProperty< T >, and otawa::GenericProperty< T >.

References _id, and Property().

Referenced by otawa::ContextualProperty::refProps().

template<class T >
const T & otawa::Property::get ( void  ) const
inline
const AbstractIdentifier * otawa::Property::getID ( elm::CString  name)
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.

Parameters
nameName of the identifier.
Returns
Allocated identifier code.

References otawa::display::find().

const Identifier * otawa::Property::id ( void  ) const
inline
void otawa::Property::print ( elm::io::Output out) const
virtual

Print the given property, that is, the identifier and its value if any.

Parameters
outOutput to use.

Referenced by otawa::operator<<().

template<class T >
void otawa::Property::set ( const T &  value)
inline

Friends And Related Function Documentation

friend class PropList
friend

Member Data Documentation

const AbstractIdentifier* otawa::Property::_id
private

Referenced by copy(), and id().


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