|
| 1 | +/********************************************************************* |
| 2 | +* Software License Agreement (BSD License) |
| 3 | +* |
| 4 | +* Copyright (c) 2016, CITEC, Bielefeld University |
| 5 | +* All rights reserved. |
| 6 | +* |
| 7 | +* Redistribution and use in source and binary forms, with or without |
| 8 | +* modification, are permitted provided that the following conditions |
| 9 | +* are met: |
| 10 | +* |
| 11 | +* * Redistributions of source code must retain the above copyright |
| 12 | +* notice, this list of conditions and the following disclaimer. |
| 13 | +* * Redistributions in binary form must reproduce the above |
| 14 | +* copyright notice, this list of conditions and the following |
| 15 | +* disclaimer in the documentation and/or other materials provided |
| 16 | +* with the distribution. |
| 17 | +* * Neither the name of the Willow Garage nor the names of its |
| 18 | +* contributors may be used to endorse or promote products derived |
| 19 | +* from this software without specific prior written permission. |
| 20 | +* |
| 21 | +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 | +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 23 | +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 24 | +* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 25 | +* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 26 | +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 27 | +* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 28 | +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 29 | +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 30 | +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 31 | +* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 32 | +* POSSIBILITY OF SUCH DAMAGE. |
| 33 | +*********************************************************************/ |
| 34 | + |
| 35 | +/* Robert Haschke */ |
| 36 | + |
| 37 | +#ifndef URDF_URDFDOM_COMPATIBILITY_ |
| 38 | +#define URDF_URDFDOM_COMPATIBILITY_ |
| 39 | + |
| 40 | +#if @URDFDOM_DECLARE_TYPES@ // This is needed for urdfdom <= 0.4 |
| 41 | + |
| 42 | +#include <boost/shared_ptr.hpp> |
| 43 | +#include <boost/weak_ptr.hpp> |
| 44 | + |
| 45 | +#define URDF_TYPEDEF_CLASS_POINTER(Class) \ |
| 46 | +class Class; \ |
| 47 | +typedef boost::shared_ptr<Class> Class##SharedPtr; \ |
| 48 | +typedef boost::shared_ptr<const Class> Class##ConstSharedPtr; \ |
| 49 | +typedef boost::weak_ptr<Class> Class##WeakPtr |
| 50 | + |
| 51 | +namespace urdf { |
| 52 | +URDF_TYPEDEF_CLASS_POINTER(Box); |
| 53 | +URDF_TYPEDEF_CLASS_POINTER(Collision); |
| 54 | +URDF_TYPEDEF_CLASS_POINTER(Cylinder); |
| 55 | +URDF_TYPEDEF_CLASS_POINTER(Geometry); |
| 56 | +URDF_TYPEDEF_CLASS_POINTER(Inertial); |
| 57 | + |
| 58 | +URDF_TYPEDEF_CLASS_POINTER(Joint); |
| 59 | +URDF_TYPEDEF_CLASS_POINTER(JointCalibration); |
| 60 | +URDF_TYPEDEF_CLASS_POINTER(JointDynamics); |
| 61 | +URDF_TYPEDEF_CLASS_POINTER(JointLimits); |
| 62 | +URDF_TYPEDEF_CLASS_POINTER(JointMimic); |
| 63 | +URDF_TYPEDEF_CLASS_POINTER(JointSafety); |
| 64 | + |
| 65 | +URDF_TYPEDEF_CLASS_POINTER(Link); |
| 66 | +URDF_TYPEDEF_CLASS_POINTER(Material); |
| 67 | +URDF_TYPEDEF_CLASS_POINTER(Mesh); |
| 68 | +URDF_TYPEDEF_CLASS_POINTER(Sphere); |
| 69 | +URDF_TYPEDEF_CLASS_POINTER(Visual); |
| 70 | + |
| 71 | +URDF_TYPEDEF_CLASS_POINTER(ModelInterface); |
| 72 | +} |
| 73 | + |
| 74 | +#undef URDF_TYPEDEF_CLASS_POINTER |
| 75 | + |
| 76 | +#else // urdfdom <= 0.4 |
| 77 | + |
| 78 | +typedef std::shared_ptr<ModelInterface> ModelInterfaceSharedPtr; |
| 79 | +typedef std::shared_ptr<const ModelInterface> ModelInterfaceConstSharedPtr; |
| 80 | +typedef std::weak_ptr<ModelInterface> ModelInterfaceWeakPtr; |
| 81 | + |
| 82 | +#endif // urdfdom > 0.4 |
| 83 | + |
| 84 | +#endif // URDF_URDFDOM_COMPATIBILITY_ |
0 commit comments