Wolframe, 0.0.3

_Wolframe::db::vm::ProgramCode Class Reference

The structure for the program code as array of instructions. More...

#include <programCode.hpp>

Public Types

typedef InstructionSet::Instruction Instruction
 
typedef InstructionSet::CondCode CondCode
 
typedef InstructionSet::OpCode OpCode
 
typedef InstructionSet::Address Address
 
typedef std::vector
< Instruction >
::const_iterator 
const_iterator
 
typedef std::vector
< Instruction >::iterator 
iterator
 

Public Member Functions

 ProgramCode ()
 Default constructor. More...
 
 ProgramCode (const ProgramCode &o)
 Copy constructor. More...
 
void add (const Instruction &instr)
 Add one instruction. More...
 
Instructionoperator[] (const Address &adr)
 Get an instruction reference by address (instruction index starting with 0) More...
 
const Instructionoperator[] (const Address &adr) const
 Get an instruction const reference by address (instruction index starting with 0) More...
 
Address size () const
 Get size of the program code in instructions. More...
 
ProgramCodeoperator() (CondCode cond, OpCode opcode, unsigned int arg=0)
 More readable program instruction definition operator. More...
 
ProgramCodeoperator() (OpCode opcode, unsigned int arg=0)
 More readable program instruction definition operator (no condition -> always executed) More...
 
void append (const ProgramCode &prg)
 Append the code of another program without joining argument sets. More...
 
Instruction get (Address &ip) const
 Get the Instruction by address (instruction pointer) More...
 
const_iterator begin () const
 Get the program start iterator. More...
 
const_iterator end () const
 Get the program end iterator. More...
 
iterator begin ()
 Get the program start iterator. More...
 
iterator end ()
 Get the program end iterator. More...
 
const_iterator at (const Address &adr) const
 Get an iterator by address (instruction pointer) More...
 
iterator at (const Address &adr)
 Get an iterator by address (instruction pointer) More...
 
void printRaw (std::ostream &out) const
 Print the program code without any symbolic information that is not available here. More...
 

Private Attributes

std::vector< Instructionm_ar
 

Detailed Description

The structure for the program code as array of instructions.

Member Typedef Documentation

Constructor & Destructor Documentation

_Wolframe::db::vm::ProgramCode::ProgramCode ( )
inline

Default constructor.

_Wolframe::db::vm::ProgramCode::ProgramCode ( const ProgramCode o)
inline

Copy constructor.

Member Function Documentation

void _Wolframe::db::vm::ProgramCode::add ( const Instruction instr)
inline

Add one instruction.

param[in] instr instruction to add

void _Wolframe::db::vm::ProgramCode::append ( const ProgramCode prg)
inline

Append the code of another program without joining argument sets.

param[in] prg program code to append

const_iterator _Wolframe::db::vm::ProgramCode::at ( const Address adr) const
inline

Get an iterator by address (instruction pointer)

iterator _Wolframe::db::vm::ProgramCode::at ( const Address adr)
inline

Get an iterator by address (instruction pointer)

const_iterator _Wolframe::db::vm::ProgramCode::begin ( ) const
inline

Get the program start iterator.

iterator _Wolframe::db::vm::ProgramCode::begin ( )
inline

Get the program start iterator.

const_iterator _Wolframe::db::vm::ProgramCode::end ( ) const
inline

Get the program end iterator.

iterator _Wolframe::db::vm::ProgramCode::end ( )
inline

Get the program end iterator.

Instruction _Wolframe::db::vm::ProgramCode::get ( Address ip) const
inline

Get the Instruction by address (instruction pointer)

param[in] ip instruction pointer

Returns
the instruction
ProgramCode& _Wolframe::db::vm::ProgramCode::operator() ( CondCode  cond,
OpCode  opcode,
unsigned int  arg = 0 
)
inline

More readable program instruction definition operator.

param[in] cond conditional code (condition for execution) param[in] opcode instruction operation code param[in] arg operation argument

Returns
self reference for subsequent calls
ProgramCode& _Wolframe::db::vm::ProgramCode::operator() ( OpCode  opcode,
unsigned int  arg = 0 
)
inline

More readable program instruction definition operator (no condition -> always executed)

param[in] opcode instruction operation code param[in] arg operation argument

Returns
self reference for subsequent calls
Instruction& _Wolframe::db::vm::ProgramCode::operator[] ( const Address adr)
inline

Get an instruction reference by address (instruction index starting with 0)

param[in] adr instruction address

Returns
the instruction reference
const Instruction& _Wolframe::db::vm::ProgramCode::operator[] ( const Address adr) const
inline

Get an instruction const reference by address (instruction index starting with 0)

param[in] adr instruction address

Returns
the instruction reference
void _Wolframe::db::vm::ProgramCode::printRaw ( std::ostream &  out) const
inline

Print the program code without any symbolic information that is not available here.

Address _Wolframe::db::vm::ProgramCode::size ( ) const
inline

Get size of the program code in instructions.

Returns
the number of instructions in the code

Member Data Documentation

std::vector<Instruction> _Wolframe::db::vm::ProgramCode::m_ar
private

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