Ignition Gazebo

API Reference

6.1.0
JointType.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 #ifndef IGNITION_GAZEBO_COMPONENTS_JOINTTYPE_HH_
18 #define IGNITION_GAZEBO_COMPONENTS_JOINTTYPE_HH_
19 
20 #include <memory>
21 #include <sdf/Joint.hh>
24 #include <ignition/gazebo/config.hh>
25 
26 namespace ignition
27 {
28 namespace gazebo
29 {
30 // Inline bracket to help doxygen filtering.
31 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
32 namespace serializers
33 {
35  {
40  public: static std::ostream &Serialize(std::ostream &_out,
41  const sdf::JointType &_type)
42  {
43  _out << static_cast<int>(_type);
44  return _out;
45  }
46 
51  public: static std::istream &Deserialize(std::istream &_in,
52  sdf::JointType &_type)
53  {
54  int type;
55  _in >> type;
56  _type = sdf::JointType(type);
57  return _in;
58  }
59  };
60 }
61 namespace components
62 {
65  using JointType = Component<sdf::JointType, class JointTypeTag,
66  serializers::JointTypeSerializer>;
68  "ign_gazebo_components.JointType", JointType)
69 }
70 }
71 }
72 }
73 
74 #endif
static std::ostream & Serialize(std::ostream &_out, const sdf::JointType &_type)
Serialization for sdf::JointType.
Definition: JointType.hh:40
STL class.
#define IGN_GAZEBO_REGISTER_COMPONENT(_compType, _classname)
Static component registration macro.
Definition: Factory.hh:373
Component< sdf::JointType, class JointTypeTag, serializers::JointTypeSerializer > JointType
A component that contains the joint type. This is a simple wrapper around sdf::JointType.
Definition: JointType.hh:66
This library is part of the Ignition Robotics project.
static std::istream & Deserialize(std::istream &_in, sdf::JointType &_type)
Deserialization for sdf::JointType.
Definition: JointType.hh:51
STL class.