DART  6.6.2
EntityNodeAspect.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2018, The DART development contributors
3  * All rights reserved.
4  *
5  * The list of contributors can be found at:
6  * https://github.com/dartsim/dart/blob/master/LICENSE
7  *
8  * This file is provided under the following "BSD-style" License:
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef DART_DYNAMICS_DETAIL_ENTITYNODEASPECT_HPP_
34 #define DART_DYNAMICS_DETAIL_ENTITYNODEASPECT_HPP_
35 
36 #include "dart/dynamics/Node.hpp"
37 
38 namespace dart {
39 namespace dynamics {
40 
41 template <class Base>
42 class EntityNode;
43 
44 namespace detail {
45 
46 //==============================================================================
48 {
50  std::string mName;
51 
53  EntityNodeProperties(const std::string& name = "");
54 
56  operator const std::string&() const;
57 };
58 
59 //==============================================================================
60 template <class Base>
63 
64 //==============================================================================
65 template <class Base, bool isCompositeBase>
66 class EntityNodeBase : public Base, public EntityNodeAspectBase<Base>
67 {
68 public:
69 
71  template <typename... Args>
72  EntityNodeBase(Args&&... args)
73  : Base(std::forward<Args>(args)...)
74  {
75  // Do nothing
76  }
77 
78  virtual ~EntityNodeBase() = default;
79 };
80 
81 //==============================================================================
82 template <class Base>
83 class EntityNodeBase<Base, true> : public common::CompositeJoiner<
84  EntityNodeAspectBase<Base>, Base >
85 {
86 public:
87 
89  template <typename... Args>
90  EntityNodeBase(Args&&... args)
91  : common::CompositeJoiner<Base, EntityNodeAspectBase<Base>>(
92  common::NoArg, std::forward<Args>(args)...)
93  {
94  // Do nothing
95  }
96 
97  virtual ~EntityNodeBase() = default;
98 };
99 
100 } // namespace detail
101 } // namespace dart
102 } // namespace dynamics
103 
104 #endif // DART_DYNAMICS_DETAIL_ENTITYNODEASPECT_HPP_
std::string * name
Definition: SkelParser.cpp:1642
Terminator for the variadic template.
Definition: CompositeJoiner.hpp:45
Inherit this class to embed Properties into your Composite object.
Definition: EmbeddedAspect.hpp:210
common::RequiresAspect< Aspect > Base
Definition: EmbeddedAspect.hpp:217
EntityNodeBase(Args &&... args)
Forwarding constructor.
Definition: EntityNodeAspect.hpp:90
Definition: EntityNodeAspect.hpp:67
EntityNodeBase(Args &&... args)
Forwarding constructor.
Definition: EntityNodeAspect.hpp:72
@ NoArg
Definition: Empty.hpp:45
Definition: BulletCollisionDetector.cpp:63
Definition: SharedLibraryManager.hpp:43
Definition: EntityNodeAspect.hpp:48
std::string mName
Name of the Entity/Node.
Definition: EntityNodeAspect.hpp:50
EntityNodeProperties(const std::string &name="")
Default constructor.
Definition: EntityNodeAspect.cpp:40