COPASI API
4.40.278
|
#include <CUnitValidator.h>
Public Member Functions | |
CUnitValidator (const CMathContainer &math, const CEvaluationTree &tree) | |
CUnitValidator (const CUnitValidator &src) | |
const CValidatedUnit & | getObjectUnit (const CObjectInterface *pObject) const |
const std::map< CObjectInterface *, CValidatedUnit > & | getObjectUnits () const |
const CValidatedUnit & | getUnit () const |
const std::vector< CValidatedUnit > & | getVariableUnits () const |
bool | validateUnits (const CUnit &unit=CUnit(CBaseUnit::undefined), const std::vector< CUnit > &variableUnits=std::vector< CUnit >()) |
bool | validateUnits (const CValidatedUnit &unit, const std::vector< CValidatedUnit > &variableUnits) |
~CUnitValidator () | |
Private Member Functions | |
CUnitValidator () | |
void | getUnits () |
bool | setUnits () |
bool | validate () |
Private Attributes | |
CMathContainer & | mMathContainer |
std::map< CEvaluationNode *, CValidatedUnit > | mNodeUnits |
std::map< CObjectInterface *, CValidatedUnit > | mObjectUnits |
std::vector< CValidatedUnit > | mProvidedVariableUnits |
CValidatedUnit | mTargetUnit |
const CEvaluationTree & | mTree |
std::vector< CValidatedUnit > | mVariableUnits |
|
private |
Default constructor
CUnitValidator::CUnitValidator | ( | const CMathContainer & | math, |
const CEvaluationTree & | tree | ||
) |
Function constructor
const | CMathContainer & math |
const | CEvaluationTree & tree |
const | std::vector< CUnit > & variableUnits (default: std::vector< CUnit >) |
References CEvaluationTree::Expression, CEvaluationTree::Function, CEvaluationTree::getType(), CEvaluationTree::MassAction, CEvaluationTree::MathExpression, mTree, mVariableUnits, CEvaluationTree::PreDefined, and CEvaluationTree::UserDefined.
CUnitValidator::CUnitValidator | ( | const CUnitValidator & | src | ) |
Copy constructor
const | CUnitValidator & src |
CUnitValidator::~CUnitValidator | ( | ) |
Destructor
const CValidatedUnit & CUnitValidator::getObjectUnit | ( | const CObjectInterface * | pObject | ) | const |
Retrieve the validated unit of the object units
const | CObjectInterface * pObject |
References CMathContainer::getMathObject(), mMathContainer, and mObjectUnits.
const std::map< CObjectInterface *, CValidatedUnit > & CUnitValidator::getObjectUnits | ( | ) | const |
Retrieve the validated object units
References mObjectUnits.
Referenced by CModelParameterGroup::getObjectUnit().
const CValidatedUnit & CUnitValidator::getUnit | ( | ) | const |
Retrieve the validated unit
References CEvaluationTree::getRoot(), mNodeUnits, and mTree.
Referenced by CEvaluationNodeCall::getUnit(), and CEvaluationNodeCall::setUnit().
|
private |
References CNodeContextIterator< Node, Context >::context(), CNodeContextIterator< Node, Context >::end(), CEvaluationNodeObject::getObjectInterfacePtr(), CEvaluationTree::getRoot(), mMathContainer, mNodeUnits, mObjectUnits, mTree, mVariableUnits, CNodeContextIterator< Node, Context >::next(), CEvaluationNode::OBJECT, CNodeContextIterator< Node, Context >::parentContextPtr(), CBaseUnit::undefined, and CEvaluationNode::VARIABLE.
Referenced by validate().
const std::vector< CValidatedUnit > & CUnitValidator::getVariableUnits | ( | ) | const |
Retrieve the validated variable units
References mVariableUnits.
Referenced by CEvaluationNodeCall::setUnit().
|
private |
References CNodeIteratorMode::Before, CNodeContextIterator< Node, Context >::end(), CEvaluationNodeVariable::getIndex(), CEvaluationNodeObject::getObjectInterfacePtr(), CEvaluationTree::getRoot(), CValidatedUnit::merge(), mMathContainer, mNodeUnits, mObjectUnits, mTargetUnit, mTree, mVariableUnits, CNodeContextIterator< Node, Context >::next(), CEvaluationNode::OBJECT, CNodeContextIterator< Node, Context >::setProcessingModes(), CBaseUnit::undefined, and CEvaluationNode::VARIABLE.
Referenced by validate().
|
private |
References CEvaluationTree::getRoot(), CEvaluationTree::getType(), getUnits(), CEvaluationTree::MassAction, mNodeUnits, mObjectUnits, mProvidedVariableUnits, mTree, mVariableUnits, and setUnits().
Referenced by validateUnits().
bool CUnitValidator::validateUnits | ( | const CUnit & | unit = CUnit(CBaseUnit::undefined) , |
const std::vector< CUnit > & | variableUnits = std::vector< CUnit >() |
||
) |
Validate the units in the tree and check whether the result matches the optional argument
const | CUnit & unit (default: CBaseUnit::undefined) |
const | std::vector< CUnit > & variableUnits (default: std::vector< CUnit >) |
References mProvidedVariableUnits, mTargetUnit, and validate().
Referenced by CModelParameterGroup::getObjectUnit(), CEvaluationNodeCall::getUnit(), and CEvaluationNodeCall::setUnit().
bool CUnitValidator::validateUnits | ( | const CValidatedUnit & | unit, |
const std::vector< CValidatedUnit > & | variableUnits | ||
) |
Validate the units in the tree and check whether the result matches the optional argument
const | CUnit & unit (default: CBaseUnit::undefined) |
References mProvidedVariableUnits, mTargetUnit, and validate().
|
private |
Referenced by getObjectUnit(), getUnits(), and setUnits().
|
private |
Referenced by getUnit(), getUnits(), setUnits(), and validate().
|
private |
Referenced by getObjectUnit(), getObjectUnits(), getUnits(), setUnits(), and validate().
|
private |
Referenced by validate(), and validateUnits().
|
private |
Referenced by setUnits(), and validateUnits().
|
private |
Referenced by CUnitValidator(), getUnit(), getUnits(), setUnits(), and validate().
|
private |
Referenced by CUnitValidator(), getUnits(), getVariableUnits(), setUnits(), and validate().