Gazebo Physics

API Reference

5.3.2
gz/physics/DataStatusMask.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef GZ_PHYSICS_DATASTATUSMASK_HH_
19 #define GZ_PHYSICS_DATASTATUSMASK_HH_
20 
22 
23 namespace ignition
24 {
25  namespace physics
26  {
33  struct IGNITION_PHYSICS_VISIBLE DataStatusMask
34  {
37  enum Condition
38  {
40  MUST = 0,
44  EITHER
45  };
46 
50  public: Condition exist;
51 
54  public: Condition queried;
55 
67 
73  public: DataStatusMask(const Condition _e = EITHER,
74  const Condition _q = EITHER,
75  const Condition _r = EITHER);
76 
85  public: static bool ConditionSatisfied(
86  const DataStatusMask::Condition _condition,
87  const bool _value);
88 
93  public: bool Satisfied(const CompositeData::DataStatus &_status) const;
94  };
95  }
96 }
97 
98 
99 #endif
@ EITHER
EITHER true or false.
Definition: gz/physics/DataStatusMask.hh:44
Condition
Specify a condition as MUST be true, MUST_NOT be true, or EITHER.
Definition: gz/physics/DataStatusMask.hh:37
Struct that describes the status of data.
Definition: gz/physics/CompositeData.hh:554
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.
@ MUST
MUST be true.
Definition: gz/physics/DataStatusMask.hh:40
Condition queried
MUST means the type must be queried. MUST_NOT means it must not be queried.
Definition: gz/physics/DataStatusMask.hh:54
bool Satisfied(const CompositeData::DataStatus &_status) const
Test whether all conditions of this DataStatusMask are satisfied by the DataStatus.
static bool ConditionSatisfied(const DataStatusMask::Condition _condition, const bool _value)
Test whether a single condition is satisfied:
This struct encodes criteria for CompositeData::DataStatus so that Read and Write operations can be d...
Definition: gz/physics/DataStatusMask.hh:33
@ MUST_NOT
MUST_NOT be true (ie. must be false)
Definition: gz/physics/DataStatusMask.hh:42
Condition exist
MUST means the type must exist in the CompositeData in order to be operated on. MUST_NOT means it mus...
Definition: gz/physics/DataStatusMask.hh:50
Condition required
MUST means the type must be required by the CompositeData. MUST_NOT means it must not be required.
Definition: gz/physics/DataStatusMask.hh:66