Gazebo Physics

API Reference

2.6.2

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.

See also
CompositeData::DataStatus
OperateOnSpecifiedData

Member Enumeration Documentation

◆ Condition

enum 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.

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]_eExist condition.
[in]_qQueried condition.
[in]_rRequired condition.

Member Function Documentation

◆ ConditionSatisfied()

static bool ConditionSatisfied ( const DataStatusMask::Condition  _condition,
const bool  _value 
)
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]_conditionCondition requirement for variable check.
    [in]_valueBoolean 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]_statusDataStatus to evaluate.
Returns
True if _status satisfies these conditions.

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).

◆ queried

Condition queried

MUST means the type must be queried. MUST_NOT means it must not be queried.

◆ 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: