#include <symbols.h>
Public Member Functions | |
frame_t () | |
Default constructor. | |
frame_t (const frame_t &) | |
Copy constructor. | |
~frame_t () | |
Destructor. | |
const frame_t & | operator= (const frame_t &) |
Assignment operator. | |
bool | operator== (const frame_t &) const |
Equality operator. | |
bool | operator!= (const frame_t &) const |
Inequality operator. | |
uint32_t | getSize () const |
Returns the number of symbols in this frame. | |
symbol_t | getSymbol (int32_t) |
Returns the Nth symbol in this frame. | |
int32_t | getIndexOf (std::string name) const |
Returns the index of the symbol with the give name. | |
symbol_t | operator[] (int32_t) |
Returns the Nth symbol in this frame. | |
const symbol_t | operator[] (int32_t) const |
Returns the Nth symbol in this frame. | |
symbol_t | addSymbol (std::string name, type_t, void *user=NULL) |
Adds a symbol of the given name and type to the frame. | |
void | add (symbol_t) |
Add all symbols from the given frame. | |
void | add (frame_t) |
Add all symbols from the given frame. | |
bool | resolve (std::string name, symbol_t &symbol) |
Resolves a name in this frame or a parent frame. | |
frame_t | getParent () throw (NoParentException) |
Returns the parent frame. | |
bool | hasParent () const |
Returns true if this frame has a parent. | |
Static Public Member Functions | |
static frame_t | createFrame () |
Creates and returns a new root-frame. | |
static frame_t | createFrame (const frame_t &parent) |
Creates and returns a new sub-frame. | |
Protected Member Functions | |
frame_t (void *) | |
Friends | |
class | symbol_t |
A frame is an ordered collection of symbols (see also symbol_t). Frames can only be accessed via an instance of frame_t. Internally, frames are reference counted and do not need to be deallocated manually.
A frame can either be a root-frame or a sub-frame. Sub-frames have a parent frame; root frames do not. When a symbol name cannot be resolved in the current frame, it is resolved recursively in the parent frame.
Frames are constructed using one of the static factory methods of frame_t.
In order to avoid cyclic references no counted reference to the parent frame is maintained. Hence, the existence of the parent frame must be ensured by other means throughout the lifetime of the sub-frame.
UTAP::frame_t::frame_t | ( | void * | ) | [protected] |
UTAP::frame_t::frame_t | ( | ) |
Default constructor.
UTAP::frame_t::frame_t | ( | const frame_t & | ) |
Copy constructor.
UTAP::frame_t::~frame_t | ( | ) |
Destructor.
void UTAP::frame_t::add | ( | frame_t | ) |
Add all symbols from the given frame.
void UTAP::frame_t::add | ( | symbol_t | ) |
Add all symbols from the given frame.
Adds a symbol of the given name and type to the frame.
Creates and returns a new sub-frame.
static frame_t UTAP::frame_t::createFrame | ( | ) | [static] |
Creates and returns a new root-frame.
int32_t UTAP::frame_t::getIndexOf | ( | std::string | name | ) | const |
Returns the index of the symbol with the give name.
frame_t UTAP::frame_t::getParent | ( | ) | throw (NoParentException) |
Returns the parent frame.
uint32_t UTAP::frame_t::getSize | ( | ) | const |
Returns the number of symbols in this frame.
symbol_t UTAP::frame_t::getSymbol | ( | int32_t | ) |
Returns the Nth symbol in this frame.
bool UTAP::frame_t::hasParent | ( | ) | const |
Returns true if this frame has a parent.
bool UTAP::frame_t::operator!= | ( | const frame_t & | ) | const |
Inequality operator.
bool UTAP::frame_t::operator== | ( | const frame_t & | ) | const |
Equality operator.
const symbol_t UTAP::frame_t::operator[] | ( | int32_t | ) | const |
Returns the Nth symbol in this frame.
symbol_t UTAP::frame_t::operator[] | ( | int32_t | ) |
Returns the Nth symbol in this frame.
bool UTAP::frame_t::resolve | ( | std::string | name, | |
symbol_t & | symbol | |||
) |
Resolves a name in this frame or a parent frame.
friend class symbol_t [friend] |