DART  6.10.1
NodeManagerJoiner.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_NODEMANAGERJOINER_HPP_
34 #define DART_DYNAMICS_DETAIL_NODEMANAGERJOINER_HPP_
35 
38 
39 namespace dart {
40 namespace dynamics {
41 
42 //==============================================================================
43 template <class Base1, class Base2>
44 template <typename Base1Arg, typename... Base2Args>
46  Base1Arg&& arg1, Base2Args&&... args2)
47  : Base1(std::forward<Base1Arg>(arg1)),
48  Base2(std::forward<Base2Args>(args2)...)
49 {
50  // Do nothing
51 }
52 
53 //==============================================================================
54 template <class Base1, class Base2>
55 template <typename Base1Arg>
57  Base1Arg&& arg1, common::NoArgTag)
58  : Base1(std::forward<Base1Arg>(arg1)), Base2()
59 {
60  // Do nothing
61 }
62 
63 //==============================================================================
64 template <class Base1, class Base2>
65 template <typename... Base2Args>
67  common::NoArgTag, Base2Args&&... args2)
68  : Base1(), Base2(std::forward<Base2Args>(args2)...)
69 {
70  // Do nothing
71 }
72 
73 //==============================================================================
75  std::size_t,
77  getNumNodes,
78  () const,
79  isSpecializedForNode,
80  ())
82  T*,
84  getNode,
85  (std::size_t index),
86  isSpecializedForNode,
87  (index))
89  const T*,
91  getNode,
92  (std::size_t index) const,
93  isSpecializedForNode,
94  (index))
95 
96 //==============================================================================
97 template <class Base1, class Base2>
98 template <class T>
99 constexpr bool
100 NodeManagerJoinerForBodyNode<Base1, Base2>::isSpecializedForNode()
101 {
102  return (
103  Base1::template isSpecializedForNode<T>()
104  || Base2::template isSpecializedForNode<T>());
105 }
106 
107 //==============================================================================
108 template <class Base1, class Base2, class... OtherBases>
109 template <typename... Args>
111  NodeManagerJoinerForBodyNode(Args&&... args)
113  Base1,
114  NodeManagerJoinerForBodyNode<Base2, OtherBases...>>(
115  std::forward<Args>(args)...)
116 {
117  // Do nothing
118 }
119 
120 //==============================================================================
121 template <class Base1, class Base2>
122 template <typename... Args>
124  Args&&... args)
125  : NodeManagerJoinerForBodyNode<Base1, Base2>(std::forward<Args>(args)...)
126 {
127  // Do nothing
128 }
129 
130 //==============================================================================
132  std::size_t,
134  getNumNodes,
135  (std::size_t treeIndex) const,
136  isSpecializedForNode,
137  (treeIndex))
139  T*,
141  getNode,
142  (std::size_t treeIndex, std::size_t nodeIndex),
143  isSpecializedForNode,
144  (treeIndex, nodeIndex))
146  const T*,
148  getNode,
149  (std::size_t treeIndex, std::size_t nodeIndex) const,
150  isSpecializedForNode,
151  (treeIndex, nodeIndex))
153  T*,
155  getNode,
156  (const std::string& name),
157  isSpecializedForNode,
158  (name))
160  const T*,
162  getNode,
163  (const std::string& name) const,
164  isSpecializedForNode,
165  (name))
166 
167 //==============================================================================
168 template <class Base1, class Base2, class... OtherBases>
169 template <typename... Args>
171  NodeManagerJoinerForSkeleton(Args&&... args)
173  Base1,
174  NodeManagerJoinerForSkeleton<Base2, OtherBases...>>(
175  std::forward<Args>(args)...)
176 {
177  // Do nothing
178 }
179 
180 } // namespace dynamics
181 } // namespace dart
182 
183 #endif // DART_DYNAMICS_DETAIL_NODEMANAGERJOINER_HPP_
std::string * name
Definition: SkelParser.cpp:1697
std::size_t index
Definition: SkelParser.cpp:1672
#define DETAIL_DART_COMMON_IRREGULAR_TEMPLATEJOINERDISPATCH_IMPL( ReturnType, ClassName, Function, Suffix, SpecializationChecker, Args)
This macro provides the implementation for most of the member functions in common::CompositeJoiner,...
Definition: TemplateJoinerDispatchMacro.hpp:42
Declaration of the variadic template.
Definition: NodeManagerJoiner.hpp:47
Declaration of variadic template.
Definition: NodeManagerJoiner.hpp:117
NoArgTag
Used to tag arguments as blank for in variadic joiner classes such as common::CompositeJoiner and dyn...
Definition: Empty.hpp:48
Definition: BulletCollisionDetector.cpp:65
Definition: SharedLibraryManager.hpp:46