Close

Relief for ODA Team in Ukraine

Learn more
ODA Drawings SDK
OdFdFieldEvaluator::evaluate Method
Syntax
C++
virtual OdResult evaluate(OdDbField* pField, int nContext, OdDbDatabase* pDb, OdFdFieldResult* pResult) const = 0;

This function is called by the field framework when the field needs to be evaluated.

Parameters
Description
pField
[in] Input field to evaluate.
nContext
[in] Input context in which the field is evaluated; this context flag is passed to the evaluator and can be one of the predefined by the OdDbField::EvalContext enumeration flags or a user-defined context flag.
pDb
[in] Input database pointer, which can be NULL if a database could not be obtained in the current context.
pResult
[in] Input field result object to set the evaluation result and status.

A field will be evaluated only when the evaluation option set in the field matches the context in which the field evaluation is invoked. For example, if a field option is set to evaluate only manually, then the field will be evaluated only when the user updates the specific field or all fields in the drawing manually. 

The evaluator should evaluate the field and set the evaluated value using OdFdFieldResult::setFieldValue() and the error status using OdFdFieldResult::setEvaluationStatus() in the passed result object, which in turn will set them in the field object. 

The passed database pointer may be NULL if the field is not a database resident and a database could not be obtained in the current context. If the field evaluation requires a database, then this method can set the evaluation error status in the field result object and return an error. 

If the evaluation fails for any reason, the previously cached result in the field object can be left intact and used as the field value. Alternatively, the cached result can be deleted and substituted with an error string (for example, "#ERR"), which will be displayed as a field value.

Copyright © 2002-2022. Open Design Alliance All rights reserved.