rdbModel::Assertion Class Reference
#include <Assertion.h>
List of all members.
Detailed Description
Assertions are used in at least two ways: 1. As part of a table description. The assertion describes a condition which should be evaluated upon a particular event, such as when a new element is to be inserted. Such assertions stick around for the life of the application instance. If the assertion is checked often, a pre-compiled version (dependent on the type of connection) can save some time. 2. As a WHERE clause in a client-institued UPDATE or SELECT. These are only around long enough to do the UPDATE or SELECT.
The bulk of the information comprising an assertion is kept in a tree whose nodes are "operations". An operation may be either a comparison ( =, <=, etc. and also "is null") or an operation which has child operations: OR, AND, NOT, for all, there exists, hence a node is a leaf node iff it's a comparison.
Once an operation has been incorporated into an Assertion or into another operation, it is 'owned' by this parent. Deleting the parent will cause its children to be deleted. Hence applications building assertions out of operators should never delete those operators.
Constructor & Destructor Documentation
rdbModel::Assertion::Assertion |
( |
Operator * |
op = 0 , |
|
|
Table * |
myTable = 0 , |
|
|
bool |
keepOp = false |
|
) |
[inline] |
|
|
Normally, operator associated with the assertion will be deleted when the assertion itself is deleted, but this won't happen if keepOp is set to true.
|
rdbModel::Assertion::Assertion |
( |
const Assertion * |
orig, |
|
|
Row * |
toBe |
|
) |
|
|
|
Copy original assertion, but, wherever a colRef is a "toBe", substitute with value from toBe row. toBe is not const because we may need to sort it.
|
|
00031 {
00032 if (!m_keepOp) delete m_op;
00033 }
|
rdbModel::Assertion::Assertion |
( |
Operator * |
op = 0 , |
|
|
Table * |
myTable = 0 , |
|
|
bool |
keepOp = false |
|
) |
[inline] |
|
|
Normally, operator associated with the assertion will be deleted when the assertion itself is deleted, but this won't happen if keepOp is set to true.
|
rdbModel::Assertion::Assertion |
( |
const Assertion * |
orig, |
|
|
Row * |
toBe |
|
) |
|
|
|
Copy original assertion, but, wherever a colRef is a "toBe", substitute with value from toBe row. toBe is not const because we may need to sort it. |
Member Function Documentation
|
00344 {
00345 Visitor::VisitorState state = v->visitAssertion(this);
00346 if (state == Visitor::VBRANCHDONE) return Visitor::VCONTINUE;
00347 return state;
00348 }
|
const std::string& rdbModel::Assertion::getName |
( |
|
) |
const [inline] |
|
const std::string& rdbModel::Assertion::getName |
( |
|
) |
const [inline] |
|
bool rdbModel::Assertion::getOld |
( |
|
) |
const [inline] |
|
|
Returns true if associated operator or descendant refers to existing row
|
bool rdbModel::Assertion::getOld |
( |
|
) |
const [inline] |
|
|
Returns true if associated operator or descendant refers to existing row
|
Operator* rdbModel::Assertion::getOperator |
( |
|
) |
const [inline] |
|
Operator* rdbModel::Assertion::getOperator |
( |
|
) |
const [inline] |
|
const std::string& rdbModel::Assertion::getPrecompiled |
( |
|
) |
const [inline] |
|
|
00197 {return m_compiled;}
|
const std::string& rdbModel::Assertion::getPrecompiled |
( |
|
) |
const [inline] |
|
|
00197 {return m_compiled;}
|
bool rdbModel::Assertion::getToBe |
( |
|
) |
const [inline] |
|
|
True if associated operator or descendant refers to future row (in which case can't call MySql::compileAssertion)
|
bool rdbModel::Assertion::getToBe |
( |
|
) |
const [inline] |
|
|
True if associated operator or descendant refers to future row (in which case can't call MySql::compileAssertion)
|
void rdbModel::Assertion::setName |
( |
const std::string & |
name |
) |
[inline] |
|
void rdbModel::Assertion::setName |
( |
const std::string & |
name |
) |
[inline] |
|
bool rdbModel::Assertion::verify |
( |
Row & |
old, |
|
|
Row & |
toBe |
|
) |
const |
|
|
verify checks if assertion (which may refer to one or both of an old row and a proposed row) holds for these arguments. Caller is responsible for fetching old row fields out of dbs if necessary May throw RdbException |
bool rdbModel::Assertion::verify |
( |
Row & |
old, |
|
|
Row & |
toBe |
|
) |
const |
|
|
verify checks if assertion (which may refer to one or both of an old row and a proposed row) holds for these arguments. Caller is responsible for fetching old row fields out of dbs if necessary May throw RdbException 00350 {
00351
00352 if (getOld() ) {
00353 old.rowSort();
00354 }
00355 if (getToBe() ) {
00356 toBe.rowSort();
00357 }
00358 return m_op->verify(old, toBe, m_myTable);
00359 }
|
Member Data Documentation
|
Let's hope that, independent of connection type, std::string is a reasonable choice for "compiled" form of the assertion |
|
m_keepOp indicates whether or not we're responsible for cleaning up resources |
|
Assertions have names so that they can be referenced elsewhere.
|
The documentation for this class was generated from the following files:
- /data0/mdestefa/bes3soft/Boss_6.5.5/dist/6.5.5/Calibration/rdbModel/rdbModel-00-00-13/rdbModel/Tables/Assertion.h
- /data0/mdestefa/bes3soft/Boss_6.5.5/dist/6.5.5/InstallArea/include/rdbModel/rdbModel/Tables/Assertion.h
- /data0/mdestefa/bes3soft/Boss_6.5.5/dist/6.5.5/Calibration/rdbModel/rdbModel-00-00-13/src/Tables/Assertion.cxx
Generated on Wed Feb 2 19:21:52 2011 for BOSS6.5.5 by
1.3.9.1