Otawa  0.10
otawa::ilp::AbstractSystem::AbstractVar Class Reference
Inheritance diagram for otawa::ilp::AbstractSystem::AbstractVar:
otawa::ilp::Var

Public Types

enum  type_t { NO_TYPE = 0, INT = 1, BIN = 2, FLOAT = 3 }
 Type of an ILP variable. More...
 

Public Member Functions

 AbstractVar (const string &name, type_t type)
 
virtual ~AbstractVar (void)
 
int index (void) const
 
const stringname (void) const
 Get the name of the variable if any. More...
 
type_t type (void) const
 Get the type of the variable. More...
 
virtual void print (io::Output &out)
 Print the name of the variable. More...
 
virtual AliastoAlias (void)
 If the variable is an alias, return it. More...
 
virtual double eval (System *sys)
 Evaluate the variable in the given system. More...
 

Private Attributes

AbstractSystem_sys
 
int _idx
 

Friends

class AbstractSystem
 

Member Enumeration Documentation

enum otawa::ilp::Var::type_t
inherited

Type of an ILP variable.

Enumerator
NO_TYPE 

Null value for ILP variable type.

INT 

Integer (default) type for ILP variable.

BIN 

Binary type (0 or 1) for ILP variable.

FLOAT 

Real type for ILP variable.

Constructor & Destructor Documentation

otawa::ilp::AbstractSystem::AbstractVar::AbstractVar ( const string name,
type_t  type 
)
otawa::ilp::AbstractSystem::AbstractVar::~AbstractVar ( void  )
virtual

Member Function Documentation

double otawa::ilp::Var::eval ( System sys)
virtualinherited

Evaluate the variable in the given system.

Parameters
sysResolved system to look in.
Returns
Value of the variable.

Reimplemented in otawa::ilp::Alias.

References otawa::ilp::System::valueOf().

int otawa::ilp::AbstractSystem::AbstractVar::index ( void  ) const
inline
String & otawa::ilp::Var::name ( void  ) const
inlineinherited

Get the name of the variable if any.

Return an empty string if there is none.

Returns
Variable name.

Referenced by otawa::tsim::BBPath::makeVarName(), otawa::display::ILPSystemDisplayer::nameOf(), and otawa::ilp::operator<<().

void otawa::ilp::Var::print ( io::Output out)
virtualinherited

Print the name of the variable.

Parameters
outOutput to use.

References otawa::ilp::Var::_name.

Referenced by otawa::ilp::operator<<().

Alias * otawa::ilp::Var::toAlias ( void  )
virtualinherited

If the variable is an alias, return it.

Returns
Alias object if it is alias, null else.

Reimplemented in otawa::ilp::Alias.

Referenced by otawa::ilp::Expression::add().

type_t otawa::ilp::Var::type ( void  ) const
inlineinherited

Get the type of the variable.

Returns
Variable type.

Friends And Related Function Documentation

friend class AbstractSystem
friend

Member Data Documentation

int otawa::ilp::AbstractSystem::AbstractVar::_idx
private
AbstractSystem* otawa::ilp::AbstractSystem::AbstractVar::_sys
private

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