Ignition Physics

API Reference

2.3.0
CanWriteData.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 IGNITION_PHYSICS_CANWRITEDATA_HH_
19 #define IGNITION_PHYSICS_CANWRITEDATA_HH_
20 
22 
23 namespace ignition
24 {
25  namespace physics
26  {
31  struct IGNITION_PHYSICS_VISIBLE WriteOptions
32  {
37  public: bool skipMissingData;
38 
41  public: bool onlyWriteUnqueriedData;
42 
48  public: explicit WriteOptions(const bool _skipMissing = false,
49  const bool _onlyUnqueried = true);
50  };
51 
101  template <typename Derived, typename Specification>
103  {
107  public: CanWriteRequiredData();
108 
113  public: template <typename CompositeType>
114  void WriteRequiredData(
115  CompositeType &_data,
116  const WriteOptions &_options = WriteOptions()) const;
117  };
118 
122  template <typename Derived, typename Specification>
124  {
128  public: CanWriteExpectedData();
129 
138  public: template <typename CompositeType>
139  void WriteExpectedData(
140  CompositeType &_data,
141  const WriteOptions &_options = WriteOptions()) const;
142  };
143  }
144 }
145 
146 #include "ignition/physics/detail/CanWriteData.hh"
147 
148 #endif
A struct that defines options for writing data to a CompositeData object.
Definition: CanWriteData.hh:31
CanWriteRequiredData provides compile-time static analysis to ensure that the inheriting class provid...
Definition: CanWriteData.hh:102
bool onlyWriteUnqueriedData
If a data type has already been queried, do not perform the write operation on it.
Definition: CanWriteData.hh:41
bool skipMissingData
If a data type is not already part of the CompositeData, then skip it instead of writing to it when t...
Definition: CanWriteData.hh:37
Definition: CanWriteData.hh:123