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

A deletable property is a genericproperty whose value will be deleted when the property is destroyed. More...

#include <otawa/prop/DeletableProperty.h>

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

Public Member Functions

 DeletableProperty (const AbstractIdentifier *id, T value)
 
 DeletableProperty (const AbstractIdentifier &id, T value)
 
 DeletableProperty (elm::CString name, T value)
 Build a new deletable property. More...
 
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...
 

Protected Member Functions

virtual ~DeletableProperty (void)
 Delete also its value. More...
 

Detailed Description

template<class T>
class otawa::DeletableProperty< T >

A deletable property is a genericproperty whose value will be deleted when the property is destroyed.

Parameters
TType of the date stored in the property.

Constructor & Destructor Documentation

template<class T >
otawa::DeletableProperty< T >::~DeletableProperty ( void  )
protectedvirtual

Delete also its value.

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

template<class T >
otawa::DeletableProperty< T >::DeletableProperty ( const AbstractIdentifier id,
value 
)
inline
template<class T >
otawa::DeletableProperty< T >::DeletableProperty ( const AbstractIdentifier id,
value 
)
inline
template<class T >
otawa::DeletableProperty< T >::DeletableProperty ( elm::CString  name,
_value 
)
inline

Build a new deletable property.

Parameters
nameAnnotation name (matching identifier is automatically retrieved).
_valueAnnotation value.

Member Function Documentation

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

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 
)
inlinestaticinherited

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  )
inlineinherited

Get the value of the property.

Returns
Value of the property.

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


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