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

This class represents identifier with a typed associated value. More...

#include <otawa/prop/Identifier.h>

Inheritance diagram for otawa::Identifier< T >:
otawa::AbstractIdentifier otawa::PropList

Classes

struct  __class
 
struct  __simple
 
class  Getter
 

Public Member Functions

 Identifier (cstring name)
 Build a new generic identifier. More...
 
 Identifier (cstring name, const T &default_value)
 Build a new generic identifier. More...
 
 Identifier (cstring name, const T &default_value, Property *prop,...)
 
 Identifier (cstring name, const T &default_value, Property *prop, VarArg &args)
 
const T & defaultValue (void) const
 
void add (PropList &list, const T &value) const
 Add a generic property to the given list with the current identifier. More...
 
void set (PropList &list, const T &value) const
 Set the value of a generic property with the current identifier to the given list. More...
 
elm::Option< T > get (const PropList &list) const
 
const T & get (const PropList &list, const T &def) const
 Get the value associated with a property matching the current identifier. More...
 
T & ref (PropList &list) const
 
const T & use (const PropList &list) const
 Get the value matching the current identifier in the given list. More...
 
const T & value (const PropList &list) const
 For internal use only. More...
 
Ref< T, Identifiervalue (PropList &list) const
 For internal use only. More...
 
void remove (PropList &list) const
 Remove the property with the current identifier from the given list. More...
 
bool exists (PropList &list) const
 Test if the given list contains a property with the current identifier. More...
 
void copy (PropList &list, Property *prop)
 
void add (PropList *list, const T &value) const
 Add a generic property to the given list with the current identifier. More...
 
void set (PropList *list, const T &value) const
 Set the value of a generic property with the current identifier to the given list. More...
 
elm::Option< T > get (const PropList *list) const
 
const T & get (const PropList *list, const T &def) const
 Get the value associated with a property matching the current identifier. More...
 
T & ref (PropList *list) const
 
const T & use (const PropList *list) const
 Get the value matching the current identifier in the given list. More...
 
const T & value (const PropList *list) const
 For internal use only. More...
 
Ref< T, Identifier< T > > value (PropList *list) const
 For internal use only. More...
 
void remove (PropList *list) const
 Remove the property with the current identifier from the given list. More...
 
bool exists (PropList *list) const
 Test if the given list contains a property with the current identifier. More...
 
void copy (PropList *list, Property *prop)
 
const T & get (const Property *prop) const
 
void set (Property *prop, const T &value) const
 
const T & operator() (const PropList &props) const
 Read the value in a functional way. More...
 
const T & operator() (const PropList *props) const
 Read the value in a functional way. More...
 
Ref< T, Identifier< T > > operator() (PropList &props) const
 Read or write a property value in a functional way. More...
 
Ref< T, Identifier< T > > operator() (PropList *props) const
 Read or write a property value in a functional way. More...
 
const T & operator() (Property *prop) const
 
virtual void print (elm::io::Output &out, const Property *prop) const
 Print the value of the given property (accordint the property matches the given identifier). More...
 
virtual void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
virtual const Typetype (void) const
 Get the identifier of data linked with this property. More...
 
virtual void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
virtual Propertycopy (Property &prop) const
 Build a copy of the given property. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void print (elm::io::Output &out, const Property *prop) const
 Print the value of the given property (accordint the property matches the given identifier). More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void printFormatted (io::Output &out, const Property *prop) const
 Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
template<>
void fromString (PropList &props, const string &str) const
 Get value of an identifier from a string and store it in the given property list. More...
 
const string name (void) const
 Get the string name of the identifier. More...
 
void print (elm::io::Output &out) const
 Print the identifier. More...
 
void print (elm::io::Output &output, const Property &prop) const
 
void printFormatted (elm::io::Output &output, const Property &prop) const
 
virtual bool equals (const Property *prop1, const Property *prop2) const
 Test if two properties are equal. More...
 
Propertycopy (Property *prop) const
 
virtual void serialize (Property *prop, elm::serial2::Serializer &serializer)
 Serialize the workspace to the current serializer. More...
 
virtual Propertyunserialize (elm::serial2::Unserializer &unserializer)
 Unserialize the workspace to the current unserializer. More...
 
PropertygetProp (const AbstractIdentifier *id) const
 Find a property by its identifier. More...
 
void setProp (Property *prop)
 Set the property in the property list removing any double. More...
 
void setProp (const AbstractIdentifier *id)
 
void removeProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier. More...
 
void removeProp (const AbstractIdentifier &id)
 
PropertyextractProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier and return it. More...
 
PropertyextractProp (const AbstractIdentifier &id)
 Remove a property matching the given identifier and return it. More...
 
void addProp (Property *prop)
 Add property to the list without checking of duplication. More...
 
void removeAllProp (const AbstractIdentifier *id)
 Remove all the properties matching the given identifier. More...
 
bool hasProp (const AbstractIdentifier &id) const
 Test if the property list contains a property matching the given identifier. More...
 
void clearProps (void)
 Remove all properties from the list. More...
 
void addProps (const PropList &props)
 Add all properties from the given property list, in a reverse order. More...
 

Static Public Member Functions

static AbstractIdentifierfind (const string &name)
 Find an abstract identifier by its name. More...
 

Static Public Attributes

static const PropList EMPTY
 This is an empty proplist for convenience. More...
 

Protected Member Functions

void initProps (Property *prop, VarArg &args)
 Add the properties found in the arguments (list of Property * ended by null) to the identifier properties. More...
 

Private Member Functions

const T & get (const Property &prop) const
 

Private Attributes

def
 

Detailed Description

template<class T>
class otawa::Identifier< T >

This class represents identifier with a typed associated value.

Identifier with a value should declared with this kind of identifier because it provides full support for reflexive facilities.

Parameters
TThe type of data stored in a property with this identifier. Note that the property management functions of this class are safer to use than the rough PropList functions because they ensure safe value type management.

Constructor & Destructor Documentation

template<class T>
otawa::Identifier< T >::Identifier ( cstring  name)
inline

Build a new generic identifier.

Parameters
nameName of the generic identifier.
template<class T>
otawa::Identifier< T >::Identifier ( cstring  name,
const T &  default_value 
)
inline

Build a new generic identifier.

Parameters
nameName of the generic identifier.
default_valueDefault value of the identifier.
template<class T>
otawa::Identifier< T >::Identifier ( cstring  name,
const T &  default_value,
Property prop,
  ... 
)
inline
template<class T>
otawa::Identifier< T >::Identifier ( cstring  name,
const T &  default_value,
Property prop,
VarArg args 
)
inline

Member Function Documentation

template<class T>
void otawa::Identifier< T >::add ( PropList list,
const T &  value 
) const
inline

Add a generic property to the given list with the current identifier.

Parameters
listList to add to.
valueValue of the property.

References otawa::PropList::addProp().

Referenced by otawa::LoopReductor::depthFirstSearch(), and otawa::display::CFGDrawer::onInit().

template<class T>
void otawa::Identifier< T >::add ( PropList list,
const T &  value 
) const
inline

Add a generic property to the given list with the current identifier.

Parameters
listList to add to.
valueValue of the property.

Referenced by otawa::Identifier< otawa::arm::Info * >::add().

void otawa::PropList::clearProps ( void  )
inherited
Property* otawa::AbstractIdentifier::copy ( Property prop) const
inlineinherited
template<class T>
void otawa::Identifier< T >::copy ( PropList list,
Property prop 
)
inline
template<class T>
void otawa::Identifier< T >::copy ( PropList list,
Property prop 
)
inline
template<class T>
virtual Property* otawa::Identifier< T >::copy ( Property prop) const
inlinevirtual

Build a copy of the given property.

Parameters
propProperty to copy.
Returns
Copy of the property.

Reimplemented from otawa::AbstractIdentifier.

template<class T>
const T& otawa::Identifier< T >::defaultValue ( void  ) const
inline
bool otawa::AbstractIdentifier::equals ( const Property prop1,
const Property prop2 
) const
virtualinherited

Test if two properties are equal.

Parameters
prop1First property.
prop2Second property.
Returns
True if they are equal, false else.
template<class T>
bool otawa::Identifier< T >::exists ( PropList list) const
inline

Test if the given list contains a property with the current identifier.

Parameters
listList to look in.
Returns
True if there is a property with current identifier, false else.

Referenced by otawa::DeadCodeAnalysis::processWorkSpace().

template<class T>
bool otawa::Identifier< T >::exists ( PropList list) const
inline

Test if the given list contains a property with the current identifier.

Parameters
listList to look in.
Returns
True if there is a property with current identifier, false else.
Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::script::Script::makeConfig().

Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inlineinherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::PropList::extractProp().

Referenced by otawa::PropList::extractProp().

AbstractIdentifier * otawa::AbstractIdentifier::find ( const string name)
staticinherited

Find an abstract identifier by its name.

Parameters
nameName of the looked identifier.
Returns
Found identifier or null.

Referenced by otawa::ProcessorPlugin::getIdentifier(), and otawa::Application::run().

template<>
void otawa::Identifier< fmlevel_t >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References elm::value_t::name(), and elm::value_t::value().

template<class T >
void otawa::Identifier< T >::fromString ( PropList props,
const string str 
) const
inlinevirtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in.

template<>
void otawa::Identifier< bool >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< int >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< unsigned int >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< long >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< unsigned long >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< long long >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< unsigned long long >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< double >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< string >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< Address >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< elm::sys::Path >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< bool >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in, elm::io::Input::scanBool(), and set().

template<>
void otawa::Identifier< int >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in, elm::io::Input::scanLong(), and set().

template<>
void otawa::Identifier< unsigned int >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in, elm::io::Input::scanULong(), and set().

template<>
void otawa::Identifier< long >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in, elm::io::Input::scanLong(), and set().

template<>
void otawa::Identifier< unsigned long >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in, elm::io::Input::scanULong(), and set().

template<>
void otawa::Identifier< long long >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in, elm::io::Input::scanLLong(), and set().

template<>
void otawa::Identifier< unsigned long long >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in, elm::io::Input::scanULLong(), and set().

template<>
void otawa::Identifier< double >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References in, elm::io::Input::scanDouble(), and set().

template<>
void otawa::Identifier< string >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References set().

template<>
void otawa::Identifier< Address >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References buf, in, elm::String::indexOf(), elm::io::Input::scanULong(), set(), and elm::String::substring().

template<>
void otawa::Identifier< elm::sys::Path >::fromString ( PropList props,
const string str 
) const
virtual

Get value of an identifier from a string and store it in the given property list.

Parameters
propsProperty list to store result into.
strString to get value from.

Reimplemented from otawa::AbstractIdentifier.

References set().

template<class T>
const T & otawa::Identifier< T >::get ( const PropList list,
const T &  def 
) const
inline

Get the value associated with a property matching the current identifier.

If the property is not found, return the default value.

Parameters
listList to look in.
defDefault value.
Returns
Found value or the default value.

References otawa::PropList::getProp().

template<class T>
elm::Option<T> otawa::Identifier< T >::get ( const PropList list) const
inline
template<class T>
const T & otawa::Identifier< T >::get ( const PropList list,
const T &  def 
) const
inline

Get the value associated with a property matching the current identifier.

If the property is not found, return the default value.

Parameters
listList to look in.
defDefault value.
Returns
Found value or the default value.
template<class T>
const T& otawa::Identifier< T >::get ( const Property prop) const
inline
template<class T>
const T & otawa::Identifier< T >::get ( const Property prop) const
inlineprivate
bool otawa::PropList::hasProp ( const AbstractIdentifier id) const
inlineinherited

Test if the property list contains a property matching the given identifier.

Parameters
idProperty identifier to look for.
Returns
True if the list contains the matching property, false else.

References otawa::PropList::getProp().

Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().

void otawa::AbstractIdentifier::initProps ( Property prop,
VarArg args 
)
protectedinherited

Add the properties found in the arguments (list of Property * ended by null) to the identifier properties.

Parameters
propFirst property.
argsNull-ended properties to scan.

References otawa::PropList::addProp(), and elm::VarArg::next().

Referenced by otawa::AbstractIdentifier::AbstractIdentifier().

template<class T>
const T & otawa::Identifier< T >::operator() ( const PropList props) const
inline

Read the value in a functional way.

Parameters
propsProperty list to read the property from.
Returns
Value of the property matching the current identifier in the list.
template<class T>
const T & otawa::Identifier< T >::operator() ( const PropList props) const
inline

Read the value in a functional way.

Parameters
propsProperty list to read the property from.
Returns
Value of the property matching the current identifier in the list.
template<class T>
Value otawa::Identifier< T >::operator() ( PropList props) const
inline

Read or write a property value in a functional way.

The returned value may be read (automatic conversion to the value) or written (using operator = to set the value or += to add a new value at the property list.

Parameters
propsProperty list to read the property from.
Returns
Value of the property matching the current identifier in the list.
template<class T>
Value otawa::Identifier< T >::operator() ( PropList props) const
inline

Read or write a property value in a functional way.

The returned value may be read (automatic conversion to the value) or written (using operator = to set the value or += to add a new value at the property list.

Parameters
propsProperty list to read the property from.
Returns
Value of the property matching the current identifier in the list.
template<class T>
const T& otawa::Identifier< T >::operator() ( Property prop) const
inline
void otawa::AbstractIdentifier::print ( elm::io::Output out) const
inherited

Print the identifier.

Parameters
outOutput stream.

References otawa::AbstractIdentifier::nam.

void otawa::AbstractIdentifier::print ( elm::io::Output output,
const Property prop 
) const
inlineinherited
template<class T>
virtual void otawa::Identifier< T >::print ( elm::io::Output output,
const Property prop 
) const
inlinevirtual

Print the value of the given property (accordint the property matches the given identifier).

It is an error to call this method with a property matching a different identifier.

Use the print() method of a property instead.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< delayed_t >::print ( elm::io::Output output,
const Property prop 
) const
virtual

Print the value of the given property (accordint the property matches the given identifier).

It is an error to call this method with a property matching a different identifier.

Use the print() method of a property instead.

Reimplemented from otawa::AbstractIdentifier.

References otawa::DELAYED_Always, otawa::DELAYED_None, and otawa::DELAYED_Taken.

void otawa::AbstractIdentifier::printFormatted ( elm::io::Output output,
const Property prop 
) const
inlineinherited
template<class T>
virtual void otawa::Identifier< T >::printFormatted ( io::Output out,
const Property prop 
) const
inlinevirtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< char >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

References otawa::escape().

template<>
void otawa::Identifier< char >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< string >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< cstring >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< PropList >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< const PropList * >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< string >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

References otawa::escape().

template<>
void otawa::Identifier< cstring >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

References otawa::escape(), and elm::CString::length().

template<>
void otawa::Identifier< PropList >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

template<>
void otawa::Identifier< const PropList * >::printFormatted ( io::Output out,
const Property prop 
) const
virtual

Print the value of the given property in a formatted way, that is, possibly to perform re-scanning after.

For example, string are quoted and special character escaped.

Parameters
outOutput to use.
propProperty to display.

Reimplemented from otawa::AbstractIdentifier.

template<class T>
T& otawa::Identifier< T >::ref ( PropList list) const
inline
template<class T>
void otawa::Identifier< T >::remove ( PropList list) const
inline

Remove the property with the current identifier from the given list.

Parameters
listList to remove from.

Referenced by otawa::ContextualProcessor::processCFG().

template<class T>
void otawa::Identifier< T >::remove ( PropList list) const
inline

Remove the property with the current identifier from the given list.

Parameters
listList to remove from.
void otawa::PropList::removeAllProp ( const AbstractIdentifier id)
inherited

Remove all the properties matching the given identifier.

Parameters
idIdentifier of properties to remove.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::LoopUnroller::unroll().

void otawa::PropList::removeProp ( const AbstractIdentifier id)
inherited
void otawa::PropList::removeProp ( const AbstractIdentifier id)
inlineinherited
void otawa::AbstractIdentifier::serialize ( Property prop,
elm::serial2::Serializer serializer 
)
virtualinherited

Serialize the workspace to the current serializer.

In the default implementation, do nothing.

Parameters
propProperty containing the value to serialize.
serializerSerializer to serialize to.
template<class T>
void otawa::Identifier< T >::set ( PropList list,
const T &  value 
) const
inline

Set the value of a generic property with the current identifier to the given list.

Parameters
listList to set in.
valueValue to set.

References otawa::sem::add(), and otawa::PropList::getProp().

template<class T>
void otawa::Identifier< T >::set ( PropList list,
const T &  value 
) const
inline

Set the value of a generic property with the current identifier to the given list.

Parameters
listList to set in.
valueValue to set.

Referenced by otawa::Identifier< otawa::arm::Info * >::set().

template<class T>
void otawa::Identifier< T >::set ( Property prop,
const T &  value 
) const
inline
void otawa::PropList::setProp ( Property prop)
inherited

Set the property in the property list removing any double.

Parameters
propProperty to set.

References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().

void otawa::PropList::setProp ( const AbstractIdentifier id)
inlineinherited
template<class T>
virtual const Type& otawa::Identifier< T >::type ( void  ) const
inlinevirtual

Get the identifier of data linked with this property.

It may return Type::no_type ever meaning that the identifier does not support type system or that it is just a flag without associated data.

Returns
Type of the associated data.

Reimplemented from otawa::AbstractIdentifier.

Property * otawa::AbstractIdentifier::unserialize ( elm::serial2::Unserializer unserializer)
virtualinherited

Unserialize the workspace to the current unserializer.

In the default implementation, do nothing.

Parameters
unserializerUnserializer to unserialize to.
Returns
Property result of unserialization, null if the property cannot be unserialized.
template<class T >
const T & otawa::Identifier< T >::use ( const PropList list) const
inline

Get the value matching the current identifier in the given list.

Cause a run-time abort if the property is not available.

Parameters
listList to look in.
Returns
Matching value.

References otawa::PropList::getProp().

template<class T>
const T & otawa::Identifier< T >::use ( const PropList list) const
inline

Get the value matching the current identifier in the given list.

Cause a run-time abort if the property is not available.

Parameters
listList to look in.
Returns
Matching value.

Referenced by otawa::Identifier< otawa::arm::Info * >::use().

template<class T >
const T & otawa::Identifier< T >::value ( const PropList list) const
inline

For internal use only.

References otawa::PropList::getProp().

template<class T >
Value otawa::Identifier< T >::value ( PropList list) const
inline

For internal use only.

References elm::value().

template<class T>
const T & otawa::Identifier< T >::value ( const PropList list) const
inline

For internal use only.

Referenced by otawa::Identifier< otawa::arm::Info * >::value().

template<class T>
Value otawa::Identifier< T >::value ( PropList list) const
inline

For internal use only.

Referenced by otawa::Identifier< otawa::arm::Info * >::value().

Member Data Documentation

template<class T>
T otawa::Identifier< T >::def
private
const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.


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