OpenWalnut  1.5.0dev
WSinglePosition.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2017 OpenWalnut Community, Hochschule Worms
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WSINGLEPOSITION_H
26 #define WSINGLEPOSITION_H
27 
28 #include <memory>
29 #include <string>
30 
31 #include "../../common/WTransferable.h"
32 #include "../../common/math/linearAlgebra/WPosition.h"
33 
34 /**
35  * Represents a single position that is transferable between modules by connectors.
36  */
37 class WSinglePosition: public WTransferable, public WPosition // NOLINT
38 {
39 public:
40  /**
41  * Shared pointer abbreviation.
42  */
43  typedef std::shared_ptr< WSinglePosition > SPtr;
44 
45  /**
46  * Const shared pointer abbreviation.
47  */
48  typedef std::shared_ptr< const WSinglePosition > ConstSPtr;
49 
50  /**
51  * Copies the specified \ref WPosition instance.
52  *
53  * \param position the instance to clone.
54  */
55  explicit WSinglePosition( const WPosition& position );
56 
57  /**
58  * Constructs an empty position.
59  */
61 
62  /**
63  * Destructs.
64  */
65  virtual ~WSinglePosition();
66 
67  /**
68  * The name of this transferable. This is useful information for the users.
69  *
70  * \return the name.
71  */
72  virtual const std::string getName() const;
73 
74  /**
75  *
76  * The description of this transferable. This is useful information for the users.
77  *
78  * \return A description
79  */
80  virtual const std::string getDescription() const;
81 
82  /**
83  * Returns a prototype instantiated with the true type of the deriving class.
84  *
85  * \return the prototype.
86  */
87  static std::shared_ptr< WPrototyped > getPrototype();
88 
89 protected:
90  /**
91  * Prototype for this dataset
92  */
93  static std::shared_ptr< WPrototyped > m_prototype;
94 };
95 
96 inline const std::string WSinglePosition::getName() const
97 {
98  return "SinglePosition";
99 }
100 
101 inline const std::string WSinglePosition::getDescription() const
102 {
103  return "A single 3D position that can be used for module connectors.";
104 }
105 
106 #endif // WSINGLEPOSITION_H
This only is a 3d double vector.
Represents a single position that is transferable between modules by connectors.
std::shared_ptr< WSinglePosition > SPtr
Shared pointer abbreviation.
static std::shared_ptr< WPrototyped > m_prototype
Prototype for this dataset.
WSinglePosition()
Constructs an empty position.
static std::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
virtual ~WSinglePosition()
Destructs.
virtual const std::string getDescription() const
The description of this transferable.
std::shared_ptr< const WSinglePosition > ConstSPtr
Const shared pointer abbreviation.
virtual const std::string getName() const
The name of this transferable.
Class building the interface for classes that might be transferred using WModuleConnector.
Definition: WTransferable.h:38