Otawa  0.10
otawa::script::NamedObject Class Reference

Named are used by script to locate a data structure passed as argument to a code processor. More...

#include <otawa/script/NamedObject.h>

Public Member Functions

 NamedObject (void)
 Anonymous named object constructor. More...
 
 NamedObject (string _name)
 Constructor with a name. More...
 
virtual ~NamedObject (void)
 
string getName (void) const
 Get the name of the object. More...
 
template<class T >
bool implements (void) const
 

Static Public Member Functions

static void declare (NamedObject *object)
 Declare a new named object. More...
 
static NamedObjectget (string name)
 Get an object by its name. More...
 

Private Member Functions

 SERIALIZABLE (NamedObject, DFIELD(name, string("")))
 

Private Attributes

string name
 

Static Private Attributes

static genstruct::AVLMap
< string, NamedObject * > 
objects
 Known named objects. More...
 

Detailed Description

Named are used by script to locate a data structure passed as argument to a code processor.

Their name allows to easily design them from the script. Classic children classes of this one includes hard::Memory, hard::Processor, etc. As serializable objects, named objects allows also to check dynamically their type.

Constructor & Destructor Documentation

otawa::script::NamedObject::NamedObject ( void  )
inline

Anonymous named object constructor.

otawa::script::NamedObject::NamedObject ( string  _name)

Constructor with a name.

The declare() function is automatically called, if the name is not empty, to make it public.

Parameters
nameName of the object.

References declare(), and name.

otawa::script::NamedObject::~NamedObject ( void  )
virtual

Member Function Documentation

void otawa::script::NamedObject::declare ( NamedObject object)
static

Declare a new named object.

Parameters
objectObject to declare.

References getName(), and objects.

Referenced by NamedObject().

NamedObject * otawa::script::NamedObject::get ( string  name)
static

Get an object by its name.

Parameters
nameNamed of the looked object.
Returns
Found object or null.

References objects.

string otawa::script::NamedObject::getName ( void  ) const
inline

Get the name of the object.

Returns
Object name.

References name.

Referenced by declare().

template<class T >
bool otawa::script::NamedObject::implements ( void  ) const
inline
otawa::script::NamedObject::SERIALIZABLE ( NamedObject  ,
DFIELD(name, string(""))   
)
private

Member Data Documentation

string otawa::script::NamedObject::name
private

Referenced by NamedObject().

genstruct::AVLMap< string, NamedObject * > otawa::script::NamedObject::objects
staticprivate

Known named objects.

Referenced by declare(), and get().


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