DART  6.7.3
CompositeNode.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_COMPOSITENODE_HPP_
34 #define DART_DYNAMICS_COMPOSITENODE_HPP_
35 
37 #include "dart/dynamics/Node.hpp"
38 
39 namespace dart {
40 namespace dynamics {
41 
42 //==============================================================================
43 template <class Base>
44 class CompositeStateNode : public Base
45 {
46 public:
47 
49 
51  template <typename... Args>
52  CompositeStateNode(Args&&... args)
53  : Base(std::forward<Args>(args)...)
54  {
55  // Do nothing
56  }
57 
58  // Documentation inherited from Node
59  void setNodeState(const Node::State& otherState) override final;
60 
61  // Documentation inherited from Node
62  std::unique_ptr<Node::State> getNodeState() const override final;
63 
64  // Documentation inherited from Node
65  void copyNodeStateTo(
66  std::unique_ptr<Node::State>& outputState) const override final;
67 };
68 
69 //==============================================================================
70 template <class Base>
71 class CompositePropertiesNode : public Base
72 {
73 public:
74 
76 
78  template <typename... Args>
79  CompositePropertiesNode(Args&&... args)
80  : Base(std::forward<Args>(args)...)
81  {
82  // Do nothing
83  }
84 
85  // Documentation inherited from Node
86  void setNodeProperties(
87  const Node::Properties& otherProperties) override final;
88 
89  // Documentation inherited from Node
90  std::unique_ptr<Node::Properties> getNodeProperties() const override final;
91 
92  // Documentation inherited from Node
93  void copyNodePropertiesTo(
94  std::unique_ptr<Node::Properties>& outputProperties) const override final;
95 };
96 
97 //==============================================================================
98 template <class Base>
100 {
101 public:
102 
104  template <typename... Args>
105  CompositeNode(Args&&... args)
107  std::forward<Args>(args)...)
108  {
109  // Do nothing
110  }
111 
112 };
113 
114 } // namespace dynamics
115 } // namespace dart
116 
118 
119 #endif // DART_DYNAMICS_COMPOSITENODE_HPP_
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply take...
Definition: Cloneable.hpp:85
Definition: CompositeNode.hpp:100
CompositeNode(Args &&... args)
Forwarding constructor.
Definition: CompositeNode.hpp:105
Definition: CompositeNode.hpp:72
CompositePropertiesNode(Args &&... args)
Forwarding constructor.
Definition: CompositeNode.hpp:79
Definition: CompositeNode.hpp:45
Node::MakeState< common::Composite::State > State
Definition: CompositeNode.hpp:48
void copyNodeStateTo(std::unique_ptr< Node::State > &outputState) const override final
Definition: CompositeNode.hpp:57
void setNodeState(const Node::State &otherState) override final
Definition: CompositeNode.hpp:43
CompositeStateNode(Args &&... args)
Forwarding constructor.
Definition: CompositeNode.hpp:52
std::unique_ptr< Node::State > getNodeState() const override final
Definition: CompositeNode.hpp:50
If your Node has a Properties class, then that Properties class should inherit this Node::Properties ...
Definition: Node.hpp:124
If your Node has a State class, then that State class should inherit this Node::State class.
Definition: Node.hpp:105
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition: Node.hpp:84
Definition: BulletCollisionDetector.cpp:63
Definition: SharedLibraryManager.hpp:43