DART  6.10.1
EntityNodeAspect.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2021, 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:
70  template <typename... Args>
71  EntityNodeBase(Args&&... args) : Base(std::forward<Args>(args)...)
72  {
73  // Do nothing
74  }
75 
76  virtual ~EntityNodeBase() = default;
77 };
78 
79 //==============================================================================
80 template <class Base>
81 class EntityNodeBase<Base, true>
82  : public common::CompositeJoiner<EntityNodeAspectBase<Base>, Base>
83 {
84 public:
86  template <typename... Args>
87  EntityNodeBase(Args&&... args)
88  : common::CompositeJoiner<Base, EntityNodeAspectBase<Base>>(
89  common::NoArg, std::forward<Args>(args)...)
90  {
91  // Do nothing
92  }
93 
94  virtual ~EntityNodeBase() = default;
95 };
96 
97 } // namespace detail
98 } // namespace dynamics
99 } // namespace dart
100 
101 #endif // DART_DYNAMICS_DETAIL_ENTITYNODEASPECT_HPP_
std::string * name
Definition: SkelParser.cpp:1697
Terminator for the variadic template.
Definition: CompositeJoiner.hpp:45
Inherit this class to embed Properties into your Composite object.
Definition: EmbeddedAspect.hpp:204
common::RequiresAspect< Aspect > Base
Definition: EmbeddedAspect.hpp:210
EntityNodeBase(Args &&... args)
Forwarding constructor.
Definition: EntityNodeAspect.hpp:87
Definition: EntityNodeAspect.hpp:67
EntityNodeBase(Args &&... args)
Forwarding constructor.
Definition: EntityNodeAspect.hpp:71
@ NoArg
Definition: Empty.hpp:49
Definition: BulletCollisionDetector.cpp:65
Definition: SharedLibraryManager.hpp:46
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