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>
Public Types | |
enum | Condition { MUST = 0, MUST_NOT, EITHER } |
Specify a condition as MUST be true, MUST_NOT be true, or EITHER. More... | |
Public Member Functions | |
DataStatusMask (const Condition _e=EITHER, const Condition _q=EITHER, const Condition _r=EITHER) | |
Default constructor. Everything is set to EITHER so that nothing is masked. More... | |
bool | Satisfied (const CompositeData::DataStatus &_status) const |
Test whether all conditions of this DataStatusMask are satisfied by the DataStatus. More... | |
Static Public Member Functions | |
static bool | ConditionSatisfied (const DataStatusMask::Condition _condition, const bool _value) |
Test whether a single condition is satisfied: More... | |
Public Attributes | |
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). More... | |
Condition | queried |
MUST means the type must be queried. MUST_NOT means it must not be queried. More... | |
Condition | required |
MUST means the type must be required by the CompositeData. MUST_NOT means it must not be required. More... | |
Detailed Description
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.
Member Enumeration Documentation
◆ Condition
enum Condition |
Constructor & Destructor Documentation
◆ DataStatusMask()
DataStatusMask | ( | const Condition | _e = EITHER , |
const Condition | _q = EITHER , |
||
const Condition | _r = EITHER |
||
) |
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.
Member Function Documentation
◆ ConditionSatisfied()
|
static |
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()
bool Satisfied | ( | const CompositeData::DataStatus & | _status | ) | const |
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.
Referenced by OperateOnSpecifiedData< Specification, SpecFinder, Operation, Performer >::Operate().
Member Data Documentation
◆ exist
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).
Referenced by CanReadExpectedData< Derived, Specification >::ReadExpectedData(), CanReadRequiredData< Derived, Specification >::ReadRequiredData(), CanWriteExpectedData< Derived, Specification >::WriteExpectedData(), and CanWriteRequiredData< Derived, Specification >::WriteRequiredData().
◆ queried
Condition queried |
MUST means the type must be queried. MUST_NOT means it must not be queried.
Referenced by CanReadExpectedData< Derived, Specification >::ReadExpectedData(), CanReadRequiredData< Derived, Specification >::ReadRequiredData(), CanWriteExpectedData< Derived, Specification >::WriteExpectedData(), and CanWriteRequiredData< Derived, Specification >::WriteRequiredData().
◆ required
Condition 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: