Otawa  0.10
otawa::GenericProperty< T > Class Template Reference

This generic class allows attaching any type of data to a property. More...

#include <otawa/prop/Property.h>

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

Public Member Functions

 GenericProperty (const AbstractIdentifier *id, const T &value)
 
 GenericProperty (const AbstractIdentifier &id, const T &value)
 
 GenericProperty (elm::CString name, const T &value)
 
virtual ~GenericProperty (void)
 
virtual Propertycopy (void)
 This method is called when a property is copied. More...
 
const T & value (void) const
 Get the value of the property. More...
 
T & value (void)
 Get the value of the property. 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 GenericProperty< T > * make (const AbstractIdentifier *id, const T &value)
 Build a new generic property with the given data. More...
 
static const AbstractIdentifiergetID (elm::CString name)
 Allocate a new identifier matching the given name. More...
 

Private Attributes

_value
 

Detailed Description

template<class T>
class otawa::GenericProperty< T >

This generic class allows attaching any type of data to a property.

Parameters
TType of the date stored in the property.

Constructor & Destructor Documentation

template<class T>
otawa::GenericProperty< T >::GenericProperty ( const AbstractIdentifier id,
const T &  value 
)
inline
template<class T>
otawa::GenericProperty< T >::GenericProperty ( const AbstractIdentifier id,
const T &  value 
)
inline
template<class T>
otawa::GenericProperty< T >::GenericProperty ( elm::CString  name,
const T &  value 
)
inline
template<class T>
virtual otawa::GenericProperty< T >::~GenericProperty ( void  )
inlinevirtual

Member Function Documentation

template<class T>
virtual Property* otawa::GenericProperty< T >::copy ( void  )
inlinevirtual

This method is called when a property is copied.

It may be specialized by Property class children.

Returns
Copy of the current property.

Reimplemented from otawa::Property.

Reimplemented in otawa::LockedProperty< T >.

References otawa::Property::id(), and otawa::GenericProperty< T >::value().

template<class T >
const T & otawa::Property::get ( void  ) const
inlineinherited
const AbstractIdentifier * otawa::Property::getID ( elm::CString  name)
staticinherited

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
inlineinherited
template<class T>
GenericProperty< T > * otawa::GenericProperty< T >::make ( const AbstractIdentifier id,
const T &  value 
)
inlinestatic

Build a new generic property with the given data.

Defining the constructor as is, allows replacing the default building behaviour by specialized ones.

Parameters
idIdentifier of the property.
valueValue of the property.
Returns
Built property.

References otawa::GenericProperty< T >::GenericProperty().

Referenced by otawa::Identifier< otawa::arm::Info * >::copy(), and otawa::Identifier< T >::ref().

void otawa::Property::print ( elm::io::Output out) const
virtualinherited

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)
inlineinherited
template<class T>
T & otawa::GenericProperty< T >::value ( void  )
inline

Get the value of the property.

Returns
Value of the property.

References otawa::GenericProperty< T >::_value.

Member Data Documentation

template<class T>
T otawa::GenericProperty< T >::_value
private

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