DART  6.7.3
NodeManagerJoiner.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2019, 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)),
59  Base2()
60 {
61  // Do nothing
62 }
63 
64 //==============================================================================
65 template <class Base1, class Base2>
66 template <typename... Base2Args>
68  common::NoArgTag, Base2Args&&... args2)
69  : Base1(),
70  Base2(std::forward<Base2Args>(args2)...)
71 {
72  // Do nothing
73 }
74 
75 //==============================================================================
76 DETAIL_DART_COMMON_IRREGULAR_TEMPLATEJOINERDISPATCH_IMPL(std::size_t, NodeManagerJoinerForBodyNode, getNumNodes, () const, isSpecializedForNode, ())
78 DETAIL_DART_COMMON_IRREGULAR_TEMPLATEJOINERDISPATCH_IMPL(const T*, NodeManagerJoinerForBodyNode, getNode, (std::size_t index) const, isSpecializedForNode, (index))
79 
80 //==============================================================================
81 template <class Base1, class Base2>
82 template <class T>
83 constexpr bool NodeManagerJoinerForBodyNode<Base1, Base2>::isSpecializedForNode()
84 {
85  return (Base1::template isSpecializedForNode<T>()
86  || Base2::template isSpecializedForNode<T>());
87 }
88 
89 //==============================================================================
90 template <class Base1, class Base2, class... OtherBases>
91 template <typename... Args>
93  Args&&... args)
94  : NodeManagerJoinerForBodyNode<Base1, NodeManagerJoinerForBodyNode<Base2, OtherBases...>>(
95  std::forward<Args>(args)...)
96 {
97  // Do nothing
98 }
99 
100 //==============================================================================
101 template <class Base1, class Base2>
102 template <typename... Args>
104  Args&&... args)
105  : NodeManagerJoinerForBodyNode<Base1, Base2>(std::forward<Args>(args)...)
106 {
107  // Do nothing
108 }
109 
110 //==============================================================================
111 DETAIL_DART_COMMON_IRREGULAR_TEMPLATEJOINERDISPATCH_IMPL(std::size_t, NodeManagerJoinerForSkeleton, getNumNodes, (std::size_t treeIndex) const, isSpecializedForNode, (treeIndex))
112 DETAIL_DART_COMMON_IRREGULAR_TEMPLATEJOINERDISPATCH_IMPL(T*, NodeManagerJoinerForSkeleton, getNode, (std::size_t treeIndex, std::size_t nodeIndex), isSpecializedForNode, (treeIndex, nodeIndex))
113 DETAIL_DART_COMMON_IRREGULAR_TEMPLATEJOINERDISPATCH_IMPL(const T*, NodeManagerJoinerForSkeleton, getNode, (std::size_t treeIndex, std::size_t nodeIndex) const, isSpecializedForNode, (treeIndex, nodeIndex))
115 DETAIL_DART_COMMON_IRREGULAR_TEMPLATEJOINERDISPATCH_IMPL(const T*, NodeManagerJoinerForSkeleton, getNode, (const std::string& name) const, isSpecializedForNode, (name))
116 
117 //==============================================================================
118 template <class Base1, class Base2, class... OtherBases>
119 template <typename... Args>
121  Args&&... args)
122  : NodeManagerJoinerForSkeleton<Base1, NodeManagerJoinerForSkeleton<Base2, OtherBases...>>(
123  std::forward<Args>(args)...)
124 {
125  // Do nothing
126 }
127 
128 } // namespace dynamics
129 } // namespace dart
130 
131 #endif // DART_DYNAMICS_DETAIL_NODEMANAGERJOINER_HPP_
std::string * name
Definition: SkelParser.cpp:1642
std::size_t index
Definition: SkelParser.cpp:1617
#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:46
Declaration of variadic template.
Definition: NodeManagerJoiner.hpp:114
NoArgTag
Used to tag arguments as blank for in variadic joiner classes such as common::CompositeJoiner and dyn...
Definition: Empty.hpp:45
Definition: BulletCollisionDetector.cpp:63
Definition: SharedLibraryManager.hpp:43