Instance of a program with statevariables. More...
#include <programInstance.hpp>
Classes | |
class | ResultFlags |
Flags defined in the database command between DO and the statement (NONEMPTY,UNIQUE) More... | |
class | StackElement |
State stack element of the virtual machine executing a transaction. More... | |
Public Member Functions | |
ProgramInstance () | |
Default constructor. More... | |
ProgramInstance (const ProgramInstance &o) | |
Copy constructor. More... | |
ProgramInstance (const ProgramImage &program_, TransactionExecStatemachine *db_stm_, LogTraceCallBack logTraceCallBack_=0, const LogTraceContext *logTraceContext_=0) | |
Constructor. More... | |
bool | execute () |
Execute the program. More... | |
const OutputR & | output () const |
Get the output of the executed program. More... | |
const DatabaseError * | lastError () const |
Get the last error of the executed program. More... | |
unsigned int | ip () const |
Get the current IP of program execution (instruction pointer) More... | |
Private Member Functions | |
ValueTupleSetR | keptResult (ArgumentIndex idx) const |
ValueTupleSetR | tupleSet (ArgumentIndex idx) const |
const types::Variant & | constArgument (ArgumentIndex idx) const |
const std::string & | statementArgument (ArgumentIndex argidx) const |
const std::string & | tagnameArgument (ArgumentIndex argidx) const |
types::Variant | loopcntArgument () const |
ArgumentIndex | columnIndex (const ValueTupleSet *valueset, ArgumentIndex nameidx) const |
const types::Variant & | selectedArgument (ArgumentIndex idx) const |
const types::Variant & | iteratorArgument (ArgumentIndex idx) const |
void | initValueIteraror (const ValueTupleSetR &valueset) |
void | initResult (const ValueTupleSetR &resultset) |
void | printIteratorColumn () |
ValueTupleSetR | fetchDatabaseResult (std::size_t nofColumns) |
void | setDatabaseError () |
Private Attributes | |
ProgramImage | m_program |
image of program to execute More... | |
TransactionExecStatemachine * | m_db_stm |
engine to process database instructions More... | |
Address | m_ip |
instruction pointer More... | |
SubroutineFrame | m_subroutine_frame |
prepared subroutine call parameter structure More... | |
bool | m_cond |
current condition flag for conditional execution ('InstructionSet::CondCode') More... | |
std::vector< StackElement > | m_stack |
execution stack More... | |
OutputR | m_output |
output More... | |
DatabaseError | m_lastError |
last database error reported More... | |
LogTraceCallBack | m_logTraceCallBack |
NULL or callback procedure for logging execution that is be called after every instruction executed. More... | |
const LogTraceContext * | m_logTraceContext |
Context for 'm_logTraceCallBack'. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from _Wolframe::db::vm::InstructionSet | |
static const char * | opCodeName (OpCode i) |
static const char * | argumentTypeName (ArgumentType i) |
Get the name of an argument type. More... | |
static ArgumentType | argumentType (OpCode i) |
get the argument type of an operation More... | |
static const char * | condCodeName (CondCode i) |
Get the name of a conditional code. More... | |
static Instruction | instruction (CondCode cond, OpCode opcode, unsigned int arg=0) |
Build an instruction from its parts. More... | |
static Instruction | instruction (OpCode opcode, unsigned int arg=0) |
Build an instruction from its parts (no condition -> always executed) More... | |
static CondCode | condCode (const Instruction &instr) |
Get the condition code of an instruction (defining on which condition the instruction is executed) More... | |
static OpCode | opCode (const Instruction &instr) |
Get the operation code of an instruction (defining what is done on execution) More... | |
static ArgumentIndex | argumentIndex (const Instruction &instr) |
Get the argument index of the instruction (addressing the argument depending on the argument type of the instruction) More... | |
static void | printProgramRaw (std::ostream &out, const std::vector< Instruction > &prg) |
Print the program code without any symbolic information that is not available here. More... | |
static std::string | instructionstr (const Instruction &instr) |
Get the instruction as string. More... | |
Instance of a program with statevariables.
typedef void(* _Wolframe::db::vm::ProgramInstance::LogTraceCallBack)(const LogTraceContext *prgcontext, unsigned int ip_) |
|
inline |
Default constructor.
|
inline |
Copy constructor.
_Wolframe::db::vm::ProgramInstance::ProgramInstance | ( | const ProgramImage & | program_, |
TransactionExecStatemachine * | db_stm_, | ||
LogTraceCallBack | logTraceCallBack_ = 0 , |
||
const LogTraceContext * | logTraceContext_ = 0 |
||
) |
Constructor.
|
private |
|
private |
bool _Wolframe::db::vm::ProgramInstance::execute | ( | ) |
Execute the program.
|
private |
|
private |
|
private |
|
inline |
Get the current IP of program execution (instruction pointer)
|
private |
|
private |
|
inline |
Get the last error of the executed program.
|
private |
|
inline |
Get the output of the executed program.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
current condition flag for conditional execution ('InstructionSet::CondCode')
|
private |
engine to process database instructions
|
private |
instruction pointer
|
private |
last database error reported
|
private |
NULL or callback procedure for logging execution that is be called after every instruction executed.
|
private |
Context for 'm_logTraceCallBack'.
|
private |
output
|
private |
image of program to execute
|
private |
execution stack
|
private |
prepared subroutine call parameter structure
Copyright © 2014 - Project Wolframe - All Rights Reserved