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

This class is used for building a lock property, that is, for taking pointer values implementing the elm::Locked class. More...

#include <otawa/prop/Property.h>

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

Public Member Functions

 LockedProperty (const AbstractIdentifier *id, T value)
 Build a new locked property. More...
 
 LockedProperty (const AbstractIdentifier &id, T value)
 Build a new locked property with a static identifier. More...
 
 LockedProperty (elm::CString name, T value)
 Build a new locked property with a named identifier. 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 ~LockedProperty (void)
 
virtual Propertycopy (void)
 This method is called when a property is copied. More...
 

Detailed Description

template<class T>
class otawa::LockedProperty< T >

This class is used for building a lock property, that is, for taking pointer values implementing the elm::Locked class.

It provides management of the lock along the life of the property: creation, copy and deletion.

Parameters
TType of the date stored in the property.

Constructor & Destructor Documentation

template<class T >
virtual otawa::LockedProperty< T >::~LockedProperty ( void  )
inlineprotectedvirtual
template<class T >
otawa::LockedProperty< T >::LockedProperty ( const AbstractIdentifier id,
_value 
)
inline

Build a new locked property.

Parameters
idProperty identifier.
_valueLock pointer value.

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

template<class T >
otawa::LockedProperty< T >::LockedProperty ( const AbstractIdentifier id,
_value 
)
inline

Build a new locked property with a static identifier.

Parameters
idProperty identifier.
_valueLock pointer value.

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

template<class T >
otawa::LockedProperty< T >::LockedProperty ( elm::CString  name,
_value 
)
inline

Build a new locked property with a named identifier.

Parameters
nameProperty identifier name.
_valueLock pointer value.

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

Member Function Documentation

template<class T >
virtual Property* otawa::LockedProperty< T >::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 from otawa::GenericProperty< 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: