Otawa  0.10
otawa::ilp::VarImpl Class Reference

Very trivial implementation of the Var class. More...

#include <otawa/ilp/impl.h>

Inheritance diagram for otawa::ilp::VarImpl:
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

 VarImpl (void)
 Anonymous variable constructor. More...
 
 VarImpl (string name)
 Named variable constructor. More...
 
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...
 

Detailed Description

Very trivial implementation of the Var class.

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::VarImpl::VarImpl ( void  )
inline

Anonymous variable constructor.

otawa::ilp::VarImpl::VarImpl ( string  name)
inline

Named variable constructor.

Parameters
nameName of the variable.

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().

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.

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