This struct encodes criteria for CompositeData::DataStatus so that Read and Write operations can be done for specific types of data (ie. required and unqueried or only existing data). It is used by OperateOnSpecifiedData at run-time.
More...
#include <DataStatusMask.hh>
|
Condition | exist |
| MUST means the type must exist in the CompositeData in order to be operated on. MUST_NOT means it must not exist (this can be used to decide whether to create the object).
|
|
Condition | queried |
| MUST means the type must be queried. MUST_NOT means it must not be queried.
|
|
Condition | required |
| MUST means the type must be required by the CompositeData. MUST_NOT means it must not be required.
|
|
This struct encodes criteria for CompositeData::DataStatus so that Read and Write operations can be done for specific types of data (ie. required and unqueried or only existing data). It is used by OperateOnSpecifiedData at run-time.
- See also
- CompositeData::DataStatus
-
OperateOnSpecifiedData
◆ Condition
Specify a condition as MUST be true, MUST_NOT be true, or EITHER.
Enumerator |
---|
MUST | MUST be true.
|
MUST_NOT | MUST_NOT be true (ie. must be false)
|
EITHER | EITHER true or false.
|
◆ DataStatusMask()
Default constructor. Everything is set to EITHER so that nothing is masked.
- Parameters
-
[in] | _e | Exist condition. |
[in] | _q | Queried condition. |
[in] | _r | Required condition. |
◆ ConditionSatisfied()
Test whether a single condition is satisfied:
- true if _condition == EITHER
- true if _condition == MUST and boolean _value == true
- true if _condition == MUST_NOT and boolean _value == false
- false otherwise
- Parameters
-
[in] | _condition | Condition requirement for variable check. |
[in] | _value | Boolean value to check. |
- Returns
- True if condition is satisfied, otherwise false.
◆ Satisfied()
Test whether all conditions of this DataStatusMask are satisfied by the DataStatus.
- Parameters
-
[in] | _status | DataStatus to evaluate. |
- Returns
- True if _status satisfies these conditions.
◆ exist
MUST means the type must exist in the CompositeData in order to be operated on. MUST_NOT means it must not exist (this can be used to decide whether to create the object).
◆ queried
MUST means the type must be queried. MUST_NOT means it must not be queried.
◆ required
MUST means the type must be required by the CompositeData. MUST_NOT means it must not be required.
Superficially, this might appear to overlap with the role of FindRequired and FindExpected, but those templates are filtering data types at compile-time whereas this will filter them during runtime. Requirements can be promoted during run-time, so they won't necessarily match the static compile-time requirements, and a user might want to dynamically choose which requirement level to operate on during run-time.
The documentation for this struct was generated from the following file: