#include <Calculator.h>
Inheritance diagram for Calculator:
Public Member Functions | ||||
Calculator (DynamicParamManager *dynamicParamManager) | ||||
Constructor for XOs that will use assemble(). | ||||
Calculator (DynamicParamManager *dynamicParamManager, int codeSize, int literalSize, int inputSize, int outputSize, int localSize, int statusSize) | ||||
Constructor for XOs that will populate Calculator piecemeal. | ||||
~Calculator () | ||||
DynamicParamManager * | getDynamicParamManager () const | |||
Gets this calculator instance's DynamicParamManager. | ||||
void | outputRegisterByReference (bool flag) | |||
Pre-execution: Configure output register to be set by reference (default), or by value. | ||||
void | appendInstruction (Instruction *newInst) | |||
Pre-execution: Appends an Instruction to the Calculator. | ||||
void | appendRegRef (RegisterReference *newRef) | |||
Pre-execution: Appends a RegisterReference to the Calculator. | ||||
void | assemble (const char *program) | |||
Pre-execution: Given a serialized program, populates Calculator. | ||||
void | bind (RegisterReference::ERegisterSet regset, TupleData *data, const TupleDescriptor &desc) | |||
Pre-execution: Binds Tuples to Register Sets when XO is populating Calculator. | ||||
TupleDescriptor | getOutputRegisterDescriptor () const | |||
Determines Output Tuple format. | ||||
TupleDescriptor | getInputRegisterDescriptor () const | |||
Determines Input Tuple format. | ||||
TupleDescriptor | getStatusRegisterDescriptor () const | |||
Determines Status Tuple format. | ||||
TupleData const *const | getStatusRegister () const | |||
Gets a pointer to Status Register Tuple. | ||||
void | zeroStatusRegister () | |||
Zeroes out the values of all TupleDatum within the Staus Register Tuple. | ||||
void | bind (TupleData *input, TupleData *output, bool takeOwnership=false, const TupleData *outputWrite=0) | |||
| ||||
void | continueOnException (bool c) | |||
Configures Calculator to either exit immediately upon exceptions or to continue execution. | ||||
void | exec () | |||
Executes program. | ||||
string | warnings () | |||
Returns a formatting string containing all warnings generated during exec(). | ||||
virtual void | initTraceSource (SharedTraceTarget pTraceTarget, std::string name) | |||
For use when initialization has to be deferred until after construction. | ||||
void | trace (TraceLevel level, std::string message) const | |||
Records a trace message. | ||||
bool | isTracing () const | |||
| ||||
bool | isTracingLevel (TraceLevel level) const | |||
Determines whether a particular level is being traced. | ||||
TraceTarget & | getTraceTarget () const | |||
| ||||
SharedTraceTarget | getSharedTraceTarget () const | |||
| ||||
std::string | getTraceSourceName () const | |||
Gets the name of this source. | ||||
void | setTraceSourceName (std::string const &n) | |||
Sets the name of this source. | ||||
TraceLevel | getMinimumTraceLevel () const | |||
void | disableTracing () | |||
Public Attributes | ||||
deque< CalcMessage > | mWarnings | |||
A deque of warnings encapsulated by CalcMessage object. | ||||
Protected Attributes | ||||
vector< Instruction * > | mCode | |||
Program instructions. | ||||
RegisterSetBinding * | mRegisterSetBinding [RegisterReference::ELastSet] | |||
How registers are bound to underlying tuples, indexed by register set (null element means the register set is not bound) Note: Referenced in class RegisterReference and CalcAssembler. | ||||
vector< RegisterReference * > | mRegisterRef [RegisterReference::ELastSet] | |||
All active registers, indexed by register set. | ||||
vector< RegisterReference * > | mRegisterReset | |||
A list of registers to be reset by next call to exec(). | ||||
TupleDescriptor * | mRegisterSetDescriptor [RegisterReference::ELastSet] | |||
A TupleDescriptor for each Register Set (i.e. | ||||
const bool | mIsUsingAssembler | |||
Assembler was/will-be used. | ||||
bool | mIsAssembling | |||
Assembler is actively assembling. | ||||
bool | mOutputRegisterByReference | |||
If set, output register can only be set by reference. | ||||
bool | mContinueOnException | |||
Exceptions cause calculator to return immediately, or do they allow execution to conitnue? | ||||
vector< FixedBuffer * > | mBuffers | |||
Actual storage used by the CalcAssembler for the literal, local and status registers. | ||||
DynamicParamManager * | mPDynamicParamManager | |||
Reference to the Dynamic Parameter Manager. | ||||
Private Member Functions | ||||
void | init (int codeSize, int literalSize, int inputSize, int outputSize, int localSize, int statusSize) | |||
Helper function for constructors. | ||||
void | unbind (RegisterReference::ERegisterSet regset, bool unbindDescriptor=true) | |||
Free up memory from bind. | ||||
Friends | ||||
class | RegisterRef | |||
class | RegisterReference | |||
class | CalcAssembler |
Definition at line 56 of file Calculator.h.
Calculator::Calculator | ( | DynamicParamManager * | dynamicParamManager | ) | [explicit] |
Constructor for XOs that will use assemble().
dynamicParamManager | the DynamicParamManager to use from calculator program. May be NULL if program doesn't make use of it. |
Definition at line 32 of file Calculator.cpp.
References init().
00032 : 00033 mIsUsingAssembler(true), 00034 mIsAssembling(false), 00035 mPDynamicParamManager(dynamicParamManager) 00036 { 00037 init(0,0,0,0,0,0); 00038 }
Calculator::Calculator | ( | DynamicParamManager * | dynamicParamManager, | |
int | codeSize, | |||
int | literalSize, | |||
int | inputSize, | |||
int | outputSize, | |||
int | localSize, | |||
int | statusSize | |||
) | [explicit] |
Constructor for XOs that will populate Calculator piecemeal.
Cannot use the assembler with this format.
dynamicParamManager | the dynamic parameter manager | |
codeSize | size of Instruction vector | |
literalSize | size of literal RegisterReference vector | |
inputSize | size of literal RegisterReference vector | |
outputSize | size of literal RegisterReference vector | |
localSize | size of literal RegisterReference vector | |
statusSize | size of literal RegisterReference vector |
Definition at line 41 of file Calculator.cpp.
References init().
00044 : 00045 mIsUsingAssembler(false), 00046 mIsAssembling(false), 00047 mPDynamicParamManager(dynamicParamManager) 00048 { 00049 init( 00050 codeSize, literalSize, inputSize, outputSize, 00051 localSize, statusSize); 00052 }
Calculator::~Calculator | ( | ) |
Definition at line 83 of file Calculator.cpp.
References RegisterReference::EFirstSet, RegisterReference::ELastSet, mBuffers, mCode, mIsUsingAssembler, mRegisterRef, mRegisterReset, and unbind().
00084 { 00085 uint i; 00086 for (i = RegisterReference::EFirstSet; 00087 i < RegisterReference::ELastSet; 00088 i++) { 00089 unbind((RegisterReference::ERegisterSet)i); 00090 } 00091 00092 if (mIsUsingAssembler) { 00093 // Assembler created all these register references, let's delete them 00094 for (i = RegisterReference::EFirstSet; 00095 i < RegisterReference::ELastSet; 00096 i++) { 00097 for (uint reg = 0; reg < mRegisterRef[i].size(); reg++) { 00098 if (mRegisterRef[i][reg]) { 00099 delete mRegisterRef[i][reg]; 00100 } 00101 } 00102 mRegisterRef[i].clear(); 00103 mRegisterReset.clear(); 00104 } 00105 00106 // Assembler created all these instructions so it's up to us 00107 // to delete them 00108 for (i = 0; i < mCode.size(); i++) { 00109 delete mCode[i]; 00110 } 00111 mCode.clear(); 00112 00113 for (i = 0; i < mBuffers.size(); i++) { 00114 delete[] mBuffers[i]; 00115 } 00116 mBuffers.clear(); 00117 } 00118 }
DynamicParamManager* Calculator::getDynamicParamManager | ( | ) | const [inline] |
Gets this calculator instance's DynamicParamManager.
Definition at line 86 of file Calculator.h.
Referenced by RegisterReference::setCalc().
00086 { 00087 return mPDynamicParamManager; 00088 }
void Calculator::outputRegisterByReference | ( | bool | flag | ) |
Pre-execution: Configure output register to be set by reference (default), or by value.
Default: True.
If flag is true, output register can only be set by reference using the reference "REF" instructions, PointerRef and NativeRef. Copy by value into the output register is disallowed, as the registers may point to another read-only register set. Reading from the output register in this mode is possible, but should only occur after the appropriate REF instruction. Output register may be passed to the Calculator in a don't care state.
If flag is false, output register is assumed to point to appropriately allocated memory and is set using copy by value instructions.
Must be set before appending instructions.
Definition at line 121 of file Calculator.cpp.
References mOutputRegisterByReference.
Referenced by CalcAssemblerTestCase::assemble(), CalcExtWinAggFuncTest::initWindowedAggDataBlock(), unitTestBool(), unitTestFloat(), unitTestLong(), unitTestNullableLocal(), unitTestPointer(), unitTestPointerCache(), unitTestStatusRegister(), unitTestWarnings(), WinAggAddTest(), WinAggAddTestStr(), WinAggDropTest(), and WinAggDropTestStr().
00122 { 00123 mOutputRegisterByReference = flag; 00124 }
void Calculator::appendInstruction | ( | Instruction * | newInst | ) | [inline] |
Pre-execution: Appends an Instruction to the Calculator.
Definition at line 120 of file Calculator.h.
Referenced by CalcAssembler::addInstruction(), testConvertDecimal(), testConvertDoubleToFloat(), testConvertExactNumberToString(), testConvertFloatToDouble(), testConvertFloatToIntTypes(), testConvertIntTypesToFloat(), testConvertStringToExactNumber(), unitTestBool(), unitTestFloat(), unitTestLong(), unitTestNullableLocal(), unitTestPointer(), unitTestPointerCache(), unitTestStatusRegister(), and unitTestWarnings().
00121 { 00122 assert(mIsUsingAssembler ? mIsAssembling : true); 00123 mCode.push_back(newInst); 00124 }
void Calculator::appendRegRef | ( | RegisterReference * | newRef | ) | [inline] |
Pre-execution: Appends a RegisterReference to the Calculator.
Must occur only before a call to exec() or bind()
Definition at line 129 of file Calculator.h.
References RegisterReference::EInput, RegisterReference::ELastSet, RegisterReference::ELiteral, RegisterReference::ELocal, RegisterReference::EOutput, RegisterReference::EStatus, RegisterReference::setCalc(), and RegisterReference::setIndex().
Referenced by testConvertDecimal(), testConvertDoubleToFloat(), testConvertExactNumberToString(), testConvertFloatToDouble(), testConvertFloatToIntTypes(), testConvertIntTypesToFloat(), testConvertStringToExactNumber(), unitTestBool(), unitTestFloat(), unitTestLong(), unitTestNullableLocal(), unitTestPointer(), unitTestPointerCache(), unitTestStatusRegister(), and unitTestWarnings().
00130 { 00131 assert(mIsUsingAssembler ? mIsAssembling : true); 00132 assert(newRef->setIndex() < RegisterReference::ELastSet); 00133 00134 // do not allow more RegisterReferences after bind() 00135 assert(!mRegisterSetBinding[RegisterReference::ELiteral]); 00136 assert(!mRegisterSetBinding[RegisterReference::EInput]); 00137 assert(!mRegisterSetBinding[RegisterReference::EOutput]); 00138 assert(!mRegisterSetBinding[RegisterReference::ELocal]); 00139 assert(!mRegisterSetBinding[RegisterReference::EStatus]); 00140 00141 mRegisterRef[newRef->setIndex()].push_back(newRef); 00142 newRef->setCalc(this); 00143 }
void Calculator::assemble | ( | const char * | program | ) |
Pre-execution: Given a serialized program, populates Calculator.
Given a serialized program, creates register sets, sets up literals and prepares instructions
Definition at line 127 of file Calculator.cpp.
References CalcAssembler::assemble(), InstructionFactory::extendedSignatures(), mIsAssembling, mIsUsingAssembler, InstructionFactory::signatures(), TRACE_FINE, and TRACE_FINEST.
Referenced by CalcAssemblerTestCase::assemble(), CalcExtWinAggFuncTest::initWindowedAggDataBlock(), CalcExtCastTest::testCalcExtCastApproxToString(), CalcExtCastTest::testCalcExtCastBigExactToString(), CalcExtCastTest::testCalcExtCastBooleanToChar(), CalcExtCastTest::testCalcExtCastBooleanToVarChar(), CalcExtCastTest::testCalcExtCastCharToBoolean(), CalcExtCastTest::testCalcExtCastCharToDecimal(), CalcExtCastTest::testCalcExtCastCharToExact(), CalcExtCastTest::testCalcExtCastDecimalToChar(), CalcExtCastTest::testCalcExtCastDecimalToStringTruncates(), CalcExtCastTest::testCalcExtCastDecimalToVarChar(), CalcExtCastTest::testCalcExtCastExactToChar(), CalcExtCastTest::testCalcExtCastExactToStringTruncates(), CalcExtCastTest::testCalcExtCastExactToVarChar(), CalcExtCastTest::testCalcExtCastStringToApprox(), CalcExtCastTest::testCalcExtCastStringToChar(), CalcExtCastTest::testCalcExtCastStringToDecimalFails(), CalcExtCastTest::testCalcExtCastStringToDecimalMinMax(), CalcExtCastTest::testCalcExtCastStringToDecimalRange(), CalcExtCastTest::testCalcExtCastStringToExactFails(), CalcExtCastTest::testCalcExtCastStringToVarChar(), CalcExtCastTest::testCalcExtCastVarCharToBoolean(), CalcExtCastTest::testCalcExtCastVarCharToDecimal(), CalcExtCastTest::testCalcExtCastVarCharToExact(), CalcExtContextTest::testCalcExtContext(), CalcExtDateTimeTest::testCalcExtConvertDateToString(), CalcExtDynamicVariableTest::testCalcExtDynamicVariable(), CalcExtDateTimeTest::testCalcExtLocalTime(), CalcExtDateTimeTest::testCalcExtLocalTimestamp(), CalcExtMathTest::testCalcExtMathAbs(), CalcExtMathTest::testCalcExtMathLogarithms(), CalcExtMathTest::testCalcExtMathPow(), CalcExtRegExpTest::testCalcExtRegExpLikeAChar(), CalcExtRegExpTest::testCalcExtRegExpLikeAVarChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAVarChar(), CalcExtStringTest::testCalcExtStringCatA2(), CalcExtStringTest::testCalcExtStringCatA3(), CalcExtStringTest::testCalcExtStringCmpA(), CalcExtStringTest::testCalcExtStringCmpOct(), CalcExtStringTest::testCalcExtStringLenBitA(), CalcExtStringTest::testCalcExtStringLenCharA(), CalcExtStringTest::testCalcExtStringLenOctA(), CalcExtStringTest::testCalcExtStringOverlayA4(), CalcExtStringTest::testCalcExtStringOverlayA5(), CalcExtStringTest::testCalcExtStringPosA(), CalcExtStringTest::testCalcExtStringSubStringA3(), CalcExtStringTest::testCalcExtStringSubStringA4(), CalcExtStringTest::testCalcExtStringToANull(), CalcExtStringTest::testCalcExtStringToLower(), CalcExtStringTest::testCalcExtStringToUpper(), CalcExtStringTest::testCalcExtStringTrim(), CalcMiscTest::testCalcRaise(), CalcMiscTest::testCalcRefInst(), CalcMiscTest::testCalcReturn(), CalcMiscTest::testCalcStatusReg(), CalcMiscTest::testCalcStatusRegZero(), WinAggAddTest(), WinAggAddTestStr(), WinAggDropTest(), and WinAggDropTestStr().
00128 { 00129 assert(mIsUsingAssembler); 00130 00131 FENNEL_TRACE( 00132 TRACE_FINEST, 00133 "Calculator instructions:" << endl << 00134 InstructionFactory::signatures()); 00135 FENNEL_TRACE( 00136 TRACE_FINEST, 00137 "Calculator extended instructions:" << endl << 00138 InstructionFactory::extendedSignatures()); 00139 FENNEL_TRACE( 00140 TRACE_FINE, 00141 "Calculator assembly = |" << endl 00142 << program << "|" << endl); 00143 00144 mIsAssembling = true; 00145 CalcAssembler assembler(this); 00146 assembler.assemble(program); 00147 mIsAssembling = false; 00148 }
void Calculator::bind | ( | RegisterReference::ERegisterSet | regset, | |
TupleData * | data, | |||
const TupleDescriptor & | desc | |||
) |
Pre-execution: Binds Tuples to Register Sets when XO is populating Calculator.
Allows for the initial bind of externally allocated register memory tuples. Used only when tuples are allocated by XO, not by Assembler
Definition at line 164 of file Calculator.cpp.
References RegisterReference::cachePointer(), RegisterReference::ELastSet, RegisterReference::ELiteral, RegisterReference::ELocal, mIsAssembling, mIsUsingAssembler, mRegisterRef, mRegisterReset, mRegisterSetBinding, mRegisterSetDescriptor, and unbind().
Referenced by TestCalculator::bind(), CalcAssembler::bindRegisters(), CalcExtWinAggFuncTest::initWindowedAggDataBlock(), CalcAssemblerTestCase::test(), CalcExtCastTest::testCalcExtCastApproxToString(), CalcExtCastTest::testCalcExtCastBigExactToString(), CalcExtCastTest::testCalcExtCastBooleanToChar(), CalcExtCastTest::testCalcExtCastBooleanToVarChar(), CalcExtCastTest::testCalcExtCastCharToBoolean(), CalcExtCastTest::testCalcExtCastCharToDecimal(), CalcExtCastTest::testCalcExtCastCharToExact(), CalcExtCastTest::testCalcExtCastDecimalToChar(), CalcExtCastTest::testCalcExtCastDecimalToStringTruncates(), CalcExtCastTest::testCalcExtCastDecimalToVarChar(), CalcExtCastTest::testCalcExtCastExactToChar(), CalcExtCastTest::testCalcExtCastExactToStringTruncates(), CalcExtCastTest::testCalcExtCastExactToVarChar(), CalcExtCastTest::testCalcExtCastStringToApprox(), CalcExtCastTest::testCalcExtCastStringToChar(), CalcExtCastTest::testCalcExtCastStringToDecimalFails(), CalcExtCastTest::testCalcExtCastStringToDecimalMinMax(), CalcExtCastTest::testCalcExtCastStringToDecimalRange(), CalcExtCastTest::testCalcExtCastStringToExactFails(), CalcExtCastTest::testCalcExtCastStringToVarChar(), CalcExtCastTest::testCalcExtCastVarCharToBoolean(), CalcExtCastTest::testCalcExtCastVarCharToDecimal(), CalcExtCastTest::testCalcExtCastVarCharToExact(), CalcExtContextTest::testCalcExtContext(), CalcExtDateTimeTest::testCalcExtConvertDateToString(), CalcExtDynamicVariableTest::testCalcExtDynamicVariable(), CalcExtDateTimeTest::testCalcExtLocalTime(), CalcExtDateTimeTest::testCalcExtLocalTimestamp(), CalcExtMathTest::testCalcExtMathAbs(), CalcExtMathTest::testCalcExtMathLogarithms(), CalcExtMathTest::testCalcExtMathPow(), CalcExtRegExpTest::testCalcExtRegExpLikeAChar(), CalcExtRegExpTest::testCalcExtRegExpLikeAVarChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAVarChar(), CalcExtStringTest::testCalcExtStringCatA2(), CalcExtStringTest::testCalcExtStringCatA3(), CalcExtStringTest::testCalcExtStringCmpA(), CalcExtStringTest::testCalcExtStringCmpOct(), CalcExtStringTest::testCalcExtStringLenBitA(), CalcExtStringTest::testCalcExtStringLenCharA(), CalcExtStringTest::testCalcExtStringLenOctA(), CalcExtStringTest::testCalcExtStringOverlayA4(), CalcExtStringTest::testCalcExtStringOverlayA5(), CalcExtStringTest::testCalcExtStringPosA(), CalcExtStringTest::testCalcExtStringSubStringA3(), CalcExtStringTest::testCalcExtStringSubStringA4(), CalcExtStringTest::testCalcExtStringToANull(), CalcExtStringTest::testCalcExtStringToLower(), CalcExtStringTest::testCalcExtStringToUpper(), CalcExtStringTest::testCalcExtStringTrim(), CalcMiscTest::testCalcRaise(), CalcMiscTest::testCalcRefInst(), CalcMiscTest::testCalcReturn(), CalcMiscTest::testCalcStatusReg(), CalcMiscTest::testCalcStatusRegZero(), unitTestBool(), unitTestFloat(), unitTestLong(), unitTestNullableLocal(), unitTestPointer(), unitTestPointerCache(), unitTestStatusRegister(), unitTestWarnings(), WinAggAddTest(), WinAggAddTestStr(), WinAggDropTest(), and WinAggDropTestStr().
00168 { 00169 assert(mIsUsingAssembler ? mIsAssembling : true); 00170 assert(regset < RegisterReference::ELastSet); 00171 assert(data); // Not strictly needed 00172 00173 // At the moment, do not allow literal and local register sets 00174 // to ever be rebound as they (may) have cached pointers. 00175 // If rebinding these register sets is a required feature, you 00176 // must reset each RegisterReference that points to these 00177 // tuples 00178 assert((regset == RegisterReference::ELiteral) ? 00179 !mRegisterSetBinding[RegisterReference::ELiteral] : true); 00180 assert((regset == RegisterReference::ELocal) ? 00181 !mRegisterSetBinding[RegisterReference::ELocal] : true); 00182 00183 unbind(regset); 00184 mRegisterSetBinding[regset] = new RegisterSetBinding(data); 00185 mRegisterSetDescriptor[regset] = new TupleDescriptor(desc); 00186 00187 // cache pointers for local and literal sets only 00188 if (regset == RegisterReference::ELiteral || 00189 regset == RegisterReference::ELocal) { 00190 for_each( 00191 mRegisterRef[regset].begin(), 00192 mRegisterRef[regset].end(), 00193 mem_fun(&RegisterReference::cachePointer)); 00194 } 00195 00196 // pre-allocate mReset vector to the largest possible value 00197 // trade memory for speed - vector should never have to reallocate 00198 // TODO: This calls reserve twice, which is wasteful, even at startup. 00199 size_t totalResetableRegisters = 00200 mRegisterRef[RegisterReference::ELiteral].size() + 00201 mRegisterRef[RegisterReference::ELocal].size(); 00202 mRegisterReset.reserve(totalResetableRegisters); 00203 }
TupleDescriptor Calculator::getOutputRegisterDescriptor | ( | ) | const |
Determines Output Tuple format.
When assemble() is used, an XO learns the format of its output from Calculator. Provides a copy of the internally held output TupleDescriptor. Should only be called after assemble(). Typically called before exec().
Definition at line 223 of file Calculator.cpp.
References RegisterReference::EOutput, and mRegisterSetDescriptor.
Referenced by CalcAssemblerTestCase::assemble(), CalcTestInfo< T >::checkResult(), exec(), CalcAssemblerTestCase::getExpectedOutput(), CalcExtWinAggFuncTest::initWindowedAggDataBlock(), CalcExtWinAggFuncTest::printOutput(), CalcExtStringTest::printOutput(), CalcExtRegExpTest::printOutput(), CalcExtMathTest::printOutput(), CalcExtDynamicVariableTest::printOutput(), CalcExtDateTimeTest::printOutput(), CalcExtContextTest::printOutput(), CalcExtCastTest::printOutput(), CalcAssemblerTestCase::setExpectedOutput(), CalcAssemblerTestCase::setExpectedOutputMax(), CalcAssemblerTestCase::setExpectedOutputMin(), CalcAssemblerTestCase::test(), CalcExtCastTest::testCalcExtCastApproxToString(), CalcExtCastTest::testCalcExtCastBigExactToString(), CalcExtCastTest::testCalcExtCastBooleanToChar(), CalcExtCastTest::testCalcExtCastBooleanToVarChar(), CalcExtCastTest::testCalcExtCastCharToBoolean(), CalcExtCastTest::testCalcExtCastCharToDecimal(), CalcExtCastTest::testCalcExtCastCharToExact(), CalcExtCastTest::testCalcExtCastDecimalToChar(), CalcExtCastTest::testCalcExtCastDecimalToStringTruncates(), CalcExtCastTest::testCalcExtCastDecimalToVarChar(), CalcExtCastTest::testCalcExtCastExactToChar(), CalcExtCastTest::testCalcExtCastExactToStringTruncates(), CalcExtCastTest::testCalcExtCastExactToVarChar(), CalcExtCastTest::testCalcExtCastStringToApprox(), CalcExtCastTest::testCalcExtCastStringToChar(), CalcExtCastTest::testCalcExtCastStringToDecimalFails(), CalcExtCastTest::testCalcExtCastStringToDecimalMinMax(), CalcExtCastTest::testCalcExtCastStringToDecimalRange(), CalcExtCastTest::testCalcExtCastStringToExactFails(), CalcExtCastTest::testCalcExtCastStringToVarChar(), CalcExtCastTest::testCalcExtCastVarCharToBoolean(), CalcExtCastTest::testCalcExtCastVarCharToDecimal(), CalcExtCastTest::testCalcExtCastVarCharToExact(), CalcExtContextTest::testCalcExtContext(), CalcExtDateTimeTest::testCalcExtConvertDateToString(), CalcExtDynamicVariableTest::testCalcExtDynamicVariable(), CalcExtDateTimeTest::testCalcExtLocalTime(), CalcExtDateTimeTest::testCalcExtLocalTimestamp(), CalcExtMathTest::testCalcExtMathAbs(), CalcExtMathTest::testCalcExtMathLogarithms(), CalcExtMathTest::testCalcExtMathPow(), CalcExtRegExpTest::testCalcExtRegExpLikeAChar(), CalcExtRegExpTest::testCalcExtRegExpLikeAVarChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAVarChar(), CalcExtStringTest::testCalcExtStringCatA2(), CalcExtStringTest::testCalcExtStringCatA3(), CalcExtStringTest::testCalcExtStringCmpA(), CalcExtStringTest::testCalcExtStringCmpOct(), CalcExtStringTest::testCalcExtStringLenBitA(), CalcExtStringTest::testCalcExtStringLenCharA(), CalcExtStringTest::testCalcExtStringLenOctA(), CalcExtStringTest::testCalcExtStringOverlayA4(), CalcExtStringTest::testCalcExtStringOverlayA5(), CalcExtStringTest::testCalcExtStringPosA(), CalcExtStringTest::testCalcExtStringSubStringA3(), CalcExtStringTest::testCalcExtStringSubStringA4(), CalcExtStringTest::testCalcExtStringToANull(), CalcExtStringTest::testCalcExtStringToLower(), CalcExtStringTest::testCalcExtStringToUpper(), CalcExtStringTest::testCalcExtStringTrim(), CalcMiscTest::testCalcRaise(), CalcMiscTest::testCalcRefInst(), CalcMiscTest::testCalcReturn(), CalcMiscTest::testCalcStatusReg(), CalcMiscTest::testCalcStatusRegZero(), WinAggAddTest(), WinAggAddTestStr(), WinAggDropTest(), and WinAggDropTestStr().
00224 { 00225 return *(mRegisterSetDescriptor[RegisterReference::EOutput]); 00226 }
TupleDescriptor Calculator::getInputRegisterDescriptor | ( | ) | const |
Determines Input Tuple format.
When assemble() is used, an XO may learn the format of its input from Calculator. The XO could use this information to double-check the integrity of the TupleDescriptor via asserts. Typically called before exec().
Definition at line 229 of file Calculator.cpp.
References RegisterReference::EInput, and mRegisterSetDescriptor.
Referenced by CalcAssemblerTestCase::assemble(), exec(), CalcAssemblerTestCase::getInput(), CalcExtWinAggFuncTest::initWindowedAggDataBlock(), CalcAssemblerTestCase::setInput(), CalcAssemblerTestCase::setInputMax(), CalcAssemblerTestCase::setInputMin(), CalcAssemblerTestCase::test(), CalcExtCastTest::testCalcExtCastApproxToString(), CalcExtCastTest::testCalcExtCastBigExactToString(), CalcExtCastTest::testCalcExtCastBooleanToChar(), CalcExtCastTest::testCalcExtCastBooleanToVarChar(), CalcExtCastTest::testCalcExtCastCharToBoolean(), CalcExtCastTest::testCalcExtCastCharToDecimal(), CalcExtCastTest::testCalcExtCastCharToExact(), CalcExtCastTest::testCalcExtCastDecimalToChar(), CalcExtCastTest::testCalcExtCastDecimalToStringTruncates(), CalcExtCastTest::testCalcExtCastDecimalToVarChar(), CalcExtCastTest::testCalcExtCastExactToChar(), CalcExtCastTest::testCalcExtCastExactToStringTruncates(), CalcExtCastTest::testCalcExtCastExactToVarChar(), CalcExtCastTest::testCalcExtCastStringToApprox(), CalcExtCastTest::testCalcExtCastStringToChar(), CalcExtCastTest::testCalcExtCastStringToDecimalFails(), CalcExtCastTest::testCalcExtCastStringToDecimalMinMax(), CalcExtCastTest::testCalcExtCastStringToDecimalRange(), CalcExtCastTest::testCalcExtCastStringToExactFails(), CalcExtCastTest::testCalcExtCastStringToVarChar(), CalcExtCastTest::testCalcExtCastVarCharToBoolean(), CalcExtCastTest::testCalcExtCastVarCharToDecimal(), CalcExtCastTest::testCalcExtCastVarCharToExact(), CalcExtContextTest::testCalcExtContext(), CalcExtDateTimeTest::testCalcExtConvertDateToString(), CalcExtDynamicVariableTest::testCalcExtDynamicVariable(), CalcExtDateTimeTest::testCalcExtLocalTime(), CalcExtDateTimeTest::testCalcExtLocalTimestamp(), CalcExtMathTest::testCalcExtMathAbs(), CalcExtMathTest::testCalcExtMathLogarithms(), CalcExtMathTest::testCalcExtMathPow(), CalcExtRegExpTest::testCalcExtRegExpLikeAChar(), CalcExtRegExpTest::testCalcExtRegExpLikeAVarChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAVarChar(), CalcExtStringTest::testCalcExtStringCatA2(), CalcExtStringTest::testCalcExtStringCatA3(), CalcExtStringTest::testCalcExtStringCmpA(), CalcExtStringTest::testCalcExtStringCmpOct(), CalcExtStringTest::testCalcExtStringLenBitA(), CalcExtStringTest::testCalcExtStringLenCharA(), CalcExtStringTest::testCalcExtStringLenOctA(), CalcExtStringTest::testCalcExtStringOverlayA4(), CalcExtStringTest::testCalcExtStringOverlayA5(), CalcExtStringTest::testCalcExtStringPosA(), CalcExtStringTest::testCalcExtStringSubStringA3(), CalcExtStringTest::testCalcExtStringSubStringA4(), CalcExtStringTest::testCalcExtStringToANull(), CalcExtStringTest::testCalcExtStringToLower(), CalcExtStringTest::testCalcExtStringToUpper(), CalcExtStringTest::testCalcExtStringTrim(), CalcMiscTest::testCalcRaise(), CalcMiscTest::testCalcRefInst(), CalcMiscTest::testCalcReturn(), CalcMiscTest::testCalcStatusReg(), CalcMiscTest::testCalcStatusRegZero(), WinAggAddTest(), and WinAggAddTestStr().
00230 { 00231 return *(mRegisterSetDescriptor[RegisterReference::EInput]); 00232 }
TupleDescriptor Calculator::getStatusRegisterDescriptor | ( | ) | const |
Determines Status Tuple format.
When assemble() is used, an XO may learn the format of its status from Calculator. The XO could use this information to double-check the integrity of other plan information. Typically called before exec().
Definition at line 235 of file Calculator.cpp.
References RegisterReference::EStatus, and mRegisterSetDescriptor.
Referenced by exec(), CalcMiscTest::testCalcRaise(), CalcMiscTest::testCalcReturn(), and CalcMiscTest::testCalcStatusReg().
00236 { 00237 return *(mRegisterSetDescriptor[RegisterReference::EStatus]); 00238 }
TupleData const *const Calculator::getStatusRegister | ( | ) | const |
Gets a pointer to Status Register Tuple.
Typically called once after Calculator configuration, as this tuple never changes.
Definition at line 241 of file Calculator.cpp.
References RegisterSetBinding::asTupleData(), RegisterReference::EStatus, and mRegisterSetBinding.
Referenced by CalcMiscTest::testCalcRaise(), CalcMiscTest::testCalcReturn(), CalcMiscTest::testCalcStatusReg(), and CalcMiscTest::testCalcStatusRegZero().
00242 { 00243 return &(mRegisterSetBinding[RegisterReference::EStatus]->asTupleData()); 00244 }
void Calculator::zeroStatusRegister | ( | ) |
Zeroes out the values of all TupleDatum within the Staus Register Tuple.
Typically this is called before the first call to exec() and should never be called between calls to exec() unless execution is being restarted at the beginning of a series of tuples.
Definition at line 246 of file Calculator.cpp.
References RegisterSetBinding::asTupleData(), RegisterReference::EStatus, mRegisterSetBinding, and mRegisterSetDescriptor.
Referenced by CalcMiscTest::testCalcStatusRegZero().
00247 { 00248 if (mRegisterSetDescriptor[RegisterReference::EStatus] != NULL) { 00249 RegisterSetBinding *statusBinding = 00250 mRegisterSetBinding[RegisterReference::EStatus]; 00251 00252 int ncols = statusBinding->asTupleData().size(); 00253 00254 for (int i = 0; i < ncols; i++) { 00255 memset( 00256 const_cast<PBuffer>((*statusBinding)[i].pData), 00257 0, 00258 (*statusBinding)[i].cbData); 00259 } 00260 } 00261 }
void Calculator::bind | ( | TupleData * | input, | |
TupleData * | output, | |||
bool | takeOwnership = false , |
|||
const TupleData * | outputWrite = 0 | |||
) |
outputWrite | (optional, use when output contains null values). |
Equivalent to output
, except it has the allocated target address of each datum which is null in output
.
takeOwnership | When true, the Calculator owns these TupleData, and will delete them in its destructor. |
Definition at line 205 of file Calculator.cpp.
References RegisterReference::EInput, RegisterReference::EOutput, mRegisterSetBinding, and unbind().
00208 { 00209 unbind(RegisterReference::EInput, false); 00210 mRegisterSetBinding[RegisterReference::EInput] = 00211 new RegisterSetBinding(input, takeOwnwership); 00212 unbind(RegisterReference::EOutput, false); 00213 if (outputWrite) { 00214 mRegisterSetBinding[RegisterReference::EOutput] = 00215 new RegisterSetBinding(output, outputWrite, takeOwnwership); 00216 } else { 00217 mRegisterSetBinding[RegisterReference::EOutput] = 00218 new RegisterSetBinding(output, takeOwnwership); 00219 } 00220 }
void Calculator::continueOnException | ( | bool | c | ) |
Configures Calculator to either exit immediately upon exceptions or to continue execution.
Definition at line 264 of file Calculator.cpp.
References mContinueOnException.
00265 { 00266 mContinueOnException = c; 00267 }
void Calculator::exec | ( | ) |
Executes program.
Definition at line 271 of file Calculator.cpp.
References RegisterReference::cachePointer(), RegisterReference::EInput, RegisterReference::EOutput, RegisterReference::EStatus, getInputRegisterDescriptor(), getOutputRegisterDescriptor(), getStatusRegisterDescriptor(), TraceSource::isTracingLevel(), mCode, mContinueOnException, mRegisterReset, mRegisterSetBinding, mWarnings, TuplePrinter::print(), TraceSource::trace(), TRACE_FINEST, and warnings().
Referenced by CalcExtWinAggFuncTest::checkWarnings(), CalcExtMathTest::checkWarnings(), CalcExtWinAggFuncTest::initWindowedAggDataBlock(), CalcAssemblerTestCase::test(), CalcExtCastTest::testCalcExtCastApproxToString(), CalcExtCastTest::testCalcExtCastBigExactToString(), CalcExtCastTest::testCalcExtCastBooleanToChar(), CalcExtCastTest::testCalcExtCastBooleanToVarChar(), CalcExtCastTest::testCalcExtCastCharToBoolean(), CalcExtCastTest::testCalcExtCastCharToDecimal(), CalcExtCastTest::testCalcExtCastCharToExact(), CalcExtCastTest::testCalcExtCastDecimalToChar(), CalcExtCastTest::testCalcExtCastDecimalToStringTruncates(), CalcExtCastTest::testCalcExtCastDecimalToVarChar(), CalcExtCastTest::testCalcExtCastExactToChar(), CalcExtCastTest::testCalcExtCastExactToStringTruncates(), CalcExtCastTest::testCalcExtCastExactToVarChar(), CalcExtCastTest::testCalcExtCastStringToApprox(), CalcExtCastTest::testCalcExtCastStringToChar(), CalcExtCastTest::testCalcExtCastStringToDecimalFails(), CalcExtCastTest::testCalcExtCastStringToDecimalMinMax(), CalcExtCastTest::testCalcExtCastStringToDecimalRange(), CalcExtCastTest::testCalcExtCastStringToExactFails(), CalcExtCastTest::testCalcExtCastStringToVarChar(), CalcExtCastTest::testCalcExtCastVarCharToBoolean(), CalcExtCastTest::testCalcExtCastVarCharToDecimal(), CalcExtCastTest::testCalcExtCastVarCharToExact(), CalcExtContextTest::testCalcExtContext(), CalcExtDateTimeTest::testCalcExtConvertDateToString(), CalcExtDynamicVariableTest::testCalcExtDynamicVariable(), CalcExtDateTimeTest::testCalcExtLocalTime(), CalcExtDateTimeTest::testCalcExtLocalTimestamp(), CalcExtMathTest::testCalcExtMathAbs(), CalcExtMathTest::testCalcExtMathLogarithms(), CalcExtMathTest::testCalcExtMathPow(), CalcExtRegExpTest::testCalcExtRegExpLikeAChar(), CalcExtRegExpTest::testCalcExtRegExpLikeAVarChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAVarChar(), CalcExtStringTest::testCalcExtStringCatA2(), CalcExtStringTest::testCalcExtStringCatA3(), CalcExtStringTest::testCalcExtStringCmpA(), CalcExtStringTest::testCalcExtStringCmpOct(), CalcExtStringTest::testCalcExtStringLenBitA(), CalcExtStringTest::testCalcExtStringLenCharA(), CalcExtStringTest::testCalcExtStringLenOctA(), CalcExtStringTest::testCalcExtStringOverlayA4(), CalcExtStringTest::testCalcExtStringOverlayA5(), CalcExtStringTest::testCalcExtStringPosA(), CalcExtStringTest::testCalcExtStringSubStringA3(), CalcExtStringTest::testCalcExtStringSubStringA4(), CalcExtStringTest::testCalcExtStringToANull(), CalcExtStringTest::testCalcExtStringToLower(), CalcExtStringTest::testCalcExtStringToUpper(), CalcExtStringTest::testCalcExtStringTrim(), CalcMiscTest::testCalcRaise(), CalcMiscTest::testCalcRefInst(), CalcMiscTest::testCalcReturn(), CalcMiscTest::testCalcStatusReg(), CalcMiscTest::testCalcStatusRegZero(), testConvertDecimal(), testConvertDoubleToFloat(), testConvertExactNumberToString(), testConvertFloatToDouble(), testConvertFloatToIntTypes(), testConvertIntTypesToFloat(), testConvertStringToExactNumber(), unitTestBool(), unitTestFloat(), unitTestLong(), unitTestNullableLocal(), unitTestPointer(), unitTestPointerCache(), unitTestStatusRegister(), unitTestWarnings(), WinAggAddTest(), WinAggAddTestStr(), WinAggDropTest(), and WinAggDropTestStr().
00272 { 00273 // Clear state from previous execution 00274 mWarnings.clear(); 00275 00276 // reset altered registers 00277 for_each( 00278 mRegisterReset.begin(), 00279 mRegisterReset.end(), 00280 mem_fun(&RegisterReference::cachePointer)); 00281 mRegisterReset.clear(); // does not change capacity 00282 00283 #ifdef DEBUG 00284 ostringstream oss; 00285 TuplePrinter p; 00286 if (isTracingLevel(TRACE_FINEST)) { 00287 oss << "Pre-Exec" << endl << "Output Register: " << endl; 00288 p.print( 00289 oss, getOutputRegisterDescriptor(), 00290 mRegisterSetBinding[RegisterReference::EOutput]->asTupleData()); 00291 oss << endl << "Input Register: " << endl; 00292 p.print( 00293 oss, getInputRegisterDescriptor(), 00294 mRegisterSetBinding[RegisterReference::EInput]->asTupleData()); 00295 oss << endl << "Status Register: " << endl; 00296 p.print( 00297 oss, getStatusRegisterDescriptor(), 00298 mRegisterSetBinding[RegisterReference::EStatus]->asTupleData()); 00299 oss << endl; 00300 trace(TRACE_FINEST, oss.str()); 00301 } 00302 #endif 00303 00304 00305 TProgramCounter pc = 0, endOfProgram; 00306 endOfProgram = mCode.size(); 00307 00308 while (pc >= 0 && pc < endOfProgram) { 00309 try { 00310 #ifdef DEBUG 00311 int oldpc = pc; 00312 string out; 00313 if (isTracingLevel(TRACE_FINEST)) { 00314 mCode[oldpc]->describe(out, true); 00315 FENNEL_TRACE( 00316 TRACE_FINEST, "BF [" << oldpc << "] " << out.c_str()); 00317 } 00318 #endif 00319 00320 mCode[pc]->exec(pc); 00321 00322 #ifdef DEBUG 00323 if (isTracingLevel(TRACE_FINEST)) { 00324 mCode[oldpc]->describe(out, true); 00325 FENNEL_TRACE( 00326 TRACE_FINEST, "AF [" << oldpc << "] " << out.c_str()); 00327 } 00328 #endif 00329 } catch (CalcMessage m) { 00330 // each instruction sets pc assuming continued execution 00331 mWarnings.push_back(m); 00332 if (!mContinueOnException) { 00333 break; 00334 } 00335 } 00336 } 00337 #ifdef DEBUG 00338 if (isTracingLevel(TRACE_FINEST)) { 00339 oss.clear(); 00340 oss << "Post-Exec" << endl << "Output Register: " << endl; 00341 p.print( 00342 oss, getOutputRegisterDescriptor(), 00343 mRegisterSetBinding[RegisterReference::EOutput]->asTupleData()); 00344 oss << endl << "Input Register: " << endl; 00345 p.print( 00346 oss, getInputRegisterDescriptor(), 00347 mRegisterSetBinding[RegisterReference::EInput]->asTupleData()); 00348 oss << endl << "Status Register: " << endl; 00349 p.print( 00350 oss, getStatusRegisterDescriptor(), 00351 mRegisterSetBinding[RegisterReference::EStatus]->asTupleData()); 00352 oss << endl << "Warnings: |" << warnings() << "|"<< endl; 00353 trace(TRACE_FINEST, oss.str()); 00354 } 00355 #endif 00356 }
string Calculator::warnings | ( | ) |
Returns a formatting string containing all warnings generated during exec().
String contains one warning per line, and includes PC and warning code. Cleared by each call to exec().
Definition at line 359 of file Calculator.cpp.
References mWarnings.
Referenced by CalcExtWinAggFuncTest::checkWarnings(), CalcExtMathTest::checkWarnings(), exec(), CalcExtStringTest::testCalcExtStringTrim(), unitTestBool(), unitTestFloat(), unitTestLong(), unitTestPointer(), unitTestPointerCache(), unitTestStatusRegister(), and unitTestWarnings().
00360 { 00361 string ret; 00362 deque<CalcMessage>::iterator iter = mWarnings.begin(), 00363 end = mWarnings.end(); 00364 int i = 0; 00365 00366 while (iter != end) { 00367 ret += boost::io::str(format("[%d]:PC=%ld Code=") % i % iter->pc); 00368 ret += iter->str; 00369 ret += " "; 00370 iter++; 00371 i++; 00372 } 00373 return ret; 00374 }
void Calculator::init | ( | int | codeSize, | |
int | literalSize, | |||
int | inputSize, | |||
int | outputSize, | |||
int | localSize, | |||
int | statusSize | |||
) | [private] |
Helper function for constructors.
Definition at line 55 of file Calculator.cpp.
References RegisterReference::EFirstSet, RegisterReference::EInput, RegisterReference::ELastSet, RegisterReference::ELiteral, RegisterReference::ELocal, RegisterReference::EOutput, RegisterReference::EStatus, mCode, mContinueOnException, mOutputRegisterByReference, mRegisterRef, mRegisterSetBinding, and mRegisterSetDescriptor.
Referenced by Calculator().
00058 { 00059 mCode.reserve(codeSize); 00060 mRegisterRef[RegisterReference::ELiteral].reserve(literalSize); 00061 mRegisterRef[RegisterReference::EInput].reserve(inputSize); 00062 mRegisterRef[RegisterReference::EOutput].reserve(outputSize); 00063 mRegisterRef[RegisterReference::ELocal].reserve(localSize); 00064 mRegisterRef[RegisterReference::EStatus].reserve(statusSize); 00065 00066 int i; 00067 for (i = RegisterReference::EFirstSet; 00068 i < RegisterReference::ELastSet; 00069 i++) { 00070 // explicitly clear registers. allows detection of rebinding 00071 // local & literal 00072 mRegisterSetBinding[i] = NULL; 00073 // explicitly clear descriptors. allows cleaner destructor 00074 mRegisterSetDescriptor[i] = NULL; 00075 } 00076 // Default is to use output register set by reference. 00077 mOutputRegisterByReference = true; 00078 00079 // Default is to continue execution after exceptions 00080 mContinueOnException = true; 00081 }
void Calculator::unbind | ( | RegisterReference::ERegisterSet | regset, | |
bool | unbindDescriptor = true | |||
) | [private] |
Free up memory from bind.
Definition at line 150 of file Calculator.cpp.
References mRegisterSetBinding, and mRegisterSetDescriptor.
Referenced by bind(), and ~Calculator().
00153 { 00154 if (unbindDescriptor && mRegisterSetDescriptor[regset]) { 00155 delete mRegisterSetDescriptor[regset]; 00156 mRegisterSetDescriptor[regset] = NULL; 00157 } 00158 if (mRegisterSetBinding[regset]) { 00159 delete mRegisterSetBinding[regset]; 00160 mRegisterSetBinding[regset] = NULL; 00161 } 00162 }
void TraceSource::initTraceSource | ( | SharedTraceTarget | pTraceTarget, | |
std::string | name | |||
) | [virtual, inherited] |
For use when initialization has to be deferred until after construction.
pTraceTarget | the TraceTarget to which messages will be sent | |
name | the name of this source |
Definition at line 46 of file TraceSource.cpp.
References TraceSource::isTracing(), TraceSource::minimumLevel, TraceSource::name, TraceSource::pTraceTarget, and TRACE_OFF.
Referenced by TestBase::beforeTestCase(), TestBase::TestBase(), and TraceSource::TraceSource().
00049 { 00050 assert(!pTraceTarget.get()); 00051 00052 pTraceTarget = pTraceTargetInit; 00053 name = nameInit; 00054 if (isTracing()) { 00055 minimumLevel = pTraceTarget->getSourceTraceLevel(name); 00056 } else { 00057 minimumLevel = TRACE_OFF; 00058 } 00059 }
void TraceSource::trace | ( | TraceLevel | level, | |
std::string | message | |||
) | const [inherited] |
Records a trace message.
Normally only called via FENNEL_TRACE.
level | severity level of event being trace | |
message | the text of the message |
Definition at line 61 of file TraceSource.cpp.
References TraceSource::getTraceTarget(), TraceSource::isTracing(), TraceSource::name, and TraceTarget::notifyTrace().
Referenced by exec(), and ExecStreamScheduler::traceStreamBufferContents().
00062 { 00063 if (isTracing()) { 00064 getTraceTarget().notifyTrace(name,level,message); 00065 } 00066 }
bool TraceSource::isTracing | ( | ) | const [inline, inherited] |
Definition at line 88 of file TraceSource.h.
Referenced by TraceSource::initTraceSource(), CalcExecStream::prepare(), and TraceSource::trace().
00089 { 00090 return pTraceTarget.get() ? true : false; 00091 }
bool TraceSource::isTracingLevel | ( | TraceLevel | level | ) | const [inline, inherited] |
Determines whether a particular level is being traced.
level | trace level to test |
Definition at line 100 of file TraceSource.h.
Referenced by ExecStreamScheduler::addGraph(), SimpleExecStreamGovernor::assignCachePages(), SimpleExecStreamGovernor::distributeCachePages(), exec(), ExecStreamScheduler::ExecStreamScheduler(), LcsClusterNodeWriter::getLastClusterPageForWrite(), LcsClusterNodeWriter::moveFromTempToIndex(), JavaSinkExecStream::stuffByteBuffer(), and ExecStreamScheduler::traceStreamBuffers().
00101 { 00102 return level >= minimumLevel; 00103 }
TraceTarget& TraceSource::getTraceTarget | ( | ) | const [inline, inherited] |
Definition at line 108 of file TraceSource.h.
Referenced by TraceSource::trace().
00109 { 00110 assert(isTracing()); 00111 return *(pTraceTarget.get()); 00112 }
SharedTraceTarget TraceSource::getSharedTraceTarget | ( | ) | const [inline, inherited] |
Definition at line 117 of file TraceSource.h.
Referenced by Database::init(), LcsClusterAppendExecStream::initLoad(), and CalcExecStream::prepare().
00118 { 00119 return pTraceTarget; 00120 }
std::string TraceSource::getTraceSourceName | ( | ) | const [inline, inherited] |
Gets the name of this source.
Useful to construct nested names for subcomponents that are also TraceSources.
Definition at line 127 of file TraceSource.h.
Referenced by LcsClusterAppendExecStream::initLoad().
00128 { 00129 return name; 00130 }
void TraceSource::setTraceSourceName | ( | std::string const & | n | ) | [inline, inherited] |
Sets the name of this source.
Useful to construct dynamic names for fine-grained filtering.
Definition at line 136 of file TraceSource.h.
00137 { 00138 name = n; 00139 }
TraceLevel TraceSource::getMinimumTraceLevel | ( | ) | const [inline, inherited] |
void TraceSource::disableTracing | ( | ) | [inherited] |
Definition at line 68 of file TraceSource.cpp.
References TraceSource::minimumLevel, TraceSource::pTraceTarget, and TRACE_OFF.
Referenced by TestBase::afterTestCase().
00069 { 00070 pTraceTarget.reset(); 00071 minimumLevel = TRACE_OFF; 00072 }
friend class RegisterRef [friend] |
Definition at line 253 of file Calculator.h.
friend class RegisterReference [friend] |
Definition at line 254 of file Calculator.h.
friend class CalcAssembler [friend] |
Definition at line 255 of file Calculator.h.
deque<CalcMessage> Calculator::mWarnings |
A deque of warnings encapsulated by CalcMessage object.
Deque is cleared by each call to exec().
Definition at line 248 of file Calculator.h.
Referenced by CalcTestInfo< T >::checkResult(), exec(), CalcAssemblerTestCase::test(), CalcExtCastTest::testCalcExtCastApproxToString(), CalcExtCastTest::testCalcExtCastBigExactToString(), CalcExtCastTest::testCalcExtCastBooleanToChar(), CalcExtCastTest::testCalcExtCastBooleanToVarChar(), CalcExtCastTest::testCalcExtCastCharToBoolean(), CalcExtCastTest::testCalcExtCastCharToDecimal(), CalcExtCastTest::testCalcExtCastCharToExact(), CalcExtCastTest::testCalcExtCastDecimalToChar(), CalcExtCastTest::testCalcExtCastDecimalToStringTruncates(), CalcExtCastTest::testCalcExtCastDecimalToVarChar(), CalcExtCastTest::testCalcExtCastExactToChar(), CalcExtCastTest::testCalcExtCastExactToStringTruncates(), CalcExtCastTest::testCalcExtCastExactToVarChar(), CalcExtCastTest::testCalcExtCastStringToApprox(), CalcExtCastTest::testCalcExtCastStringToChar(), CalcExtCastTest::testCalcExtCastStringToDecimalFails(), CalcExtCastTest::testCalcExtCastStringToDecimalMinMax(), CalcExtCastTest::testCalcExtCastStringToDecimalRange(), CalcExtCastTest::testCalcExtCastStringToExactFails(), CalcExtCastTest::testCalcExtCastStringToVarChar(), CalcExtCastTest::testCalcExtCastVarCharToBoolean(), CalcExtCastTest::testCalcExtCastVarCharToDecimal(), CalcExtCastTest::testCalcExtCastVarCharToExact(), CalcExtRegExpTest::testCalcExtRegExpLikeAChar(), CalcExtRegExpTest::testCalcExtRegExpLikeAVarChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAVarChar(), CalcExtStringTest::testCalcExtStringCatA2(), CalcExtStringTest::testCalcExtStringCatA3(), CalcExtStringTest::testCalcExtStringOverlayA4(), CalcExtStringTest::testCalcExtStringOverlayA5(), CalcExtStringTest::testCalcExtStringSubStringA3(), CalcExtStringTest::testCalcExtStringSubStringA4(), CalcExtStringTest::testCalcExtStringToANull(), CalcExtStringTest::testCalcExtStringToLower(), CalcExtStringTest::testCalcExtStringToUpper(), CalcExtStringTest::testCalcExtStringTrim(), CalcMiscTest::testCalcRaise(), unitTestBool(), unitTestFloat(), unitTestLong(), unitTestWarnings(), and warnings().
vector<Instruction *> Calculator::mCode [protected] |
Program instructions.
Definition at line 258 of file Calculator.h.
Referenced by exec(), init(), and ~Calculator().
RegisterSetBinding* Calculator::mRegisterSetBinding[RegisterReference::ELastSet] [protected] |
How registers are bound to underlying tuples, indexed by register set (null element means the register set is not bound) Note: Referenced in class RegisterReference and CalcAssembler.
Definition at line 263 of file Calculator.h.
Referenced by bind(), exec(), getStatusRegister(), init(), RegisterReference::setCalc(), unbind(), zeroStatusRegister(), and CalcAssembler::~CalcAssembler().
vector<RegisterReference *> Calculator::mRegisterRef[RegisterReference::ELastSet] [protected] |
All active registers, indexed by register set.
Note: Referenced in class CalcAssembler
Definition at line 268 of file Calculator.h.
Referenced by bind(), CalcAssembler::getRegister(), CalcAssembler::getRegisterSize(), init(), and ~Calculator().
vector<RegisterReference *> Calculator::mRegisterReset [protected] |
A list of registers to be reset by next call to exec().
Note: mRegisterReset is appended to in class RegisterReference
Definition at line 273 of file Calculator.h.
Referenced by bind(), exec(), RegisterReference::setCalc(), and ~Calculator().
TupleDescriptor* Calculator::mRegisterSetDescriptor[RegisterReference::ELastSet] [protected] |
A TupleDescriptor for each Register Set (i.e.
each register tuple)
Used by XO to determine tuple layouts after a serialized program is assembled. Also needed for Pointer types to determine column width. Populated by the CalcAssembler.
Definition at line 281 of file Calculator.h.
Referenced by bind(), CalcAssembler::bindRegisters(), getInputRegisterDescriptor(), getOutputRegisterDescriptor(), getStatusRegisterDescriptor(), init(), RegisterReference::setCalc(), unbind(), and zeroStatusRegister().
const bool Calculator::mIsUsingAssembler [protected] |
Assembler was/will-be used.
Definition at line 284 of file Calculator.h.
Referenced by assemble(), bind(), and ~Calculator().
bool Calculator::mIsAssembling [protected] |
Assembler is actively assembling.
Definition at line 286 of file Calculator.h.
Referenced by assemble(), CalcAssembler::assemble(), and bind().
bool Calculator::mOutputRegisterByReference [protected] |
If set, output register can only be set by reference.
Definition at line 288 of file Calculator.h.
Referenced by init(), outputRegisterByReference(), and RegisterReference::setCalc().
bool Calculator::mContinueOnException [protected] |
Exceptions cause calculator to return immediately, or do they allow execution to conitnue?
Definition at line 291 of file Calculator.h.
Referenced by continueOnException(), exec(), and init().
vector<FixedBuffer*> Calculator::mBuffers [protected] |
Actual storage used by the CalcAssembler for the literal, local and status registers.
Definition at line 295 of file Calculator.h.
Referenced by CalcAssembler::bindRegisters(), and ~Calculator().
DynamicParamManager* Calculator::mPDynamicParamManager [protected] |