MIRA
TransformProperty.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * and
5  * Neuroinformatics and Cognitive Robotics Labs (NICR) at TU Ilmenau, GERMANY
6  * All rights reserved.
7  *
8  * Contact: info@mira-project.org
9  *
10  * Commercial Usage:
11  * Licensees holding valid commercial licenses may use this file in
12  * accordance with the commercial license agreement provided with the
13  * software or, alternatively, in accordance with the terms contained in
14  * a written agreement between you and MLAB or NICR.
15  *
16  * GNU General Public License Usage:
17  * Alternatively, this file may be used under the terms of the GNU
18  * General Public License version 3.0 as published by the Free Software
19  * Foundation and appearing in the file LICENSE.GPL3 included in the
20  * packaging of this file. Please review the following information to
21  * ensure the GNU General Public License version 3.0 requirements will be
22  * met: http://www.gnu.org/copyleft/gpl.html.
23  * Alternatively you may (at your option) use any later version of the GNU
24  * General Public License if such license has been publicly approved by
25  * MLAB and NICR (or its successors, if any).
26  *
27  * IN NO EVENT SHALL "MLAB" OR "NICR" BE LIABLE TO ANY PARTY FOR DIRECT,
28  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
29  * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLAB" OR
30  * "NICR" HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * "MLAB" AND "NICR" SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
33  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
34  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
35  * ON AN "AS IS" BASIS, AND "MLAB" AND "NICR" HAVE NO OBLIGATION TO
36  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
37  */
38 
47 #ifndef _MIRA_TRANSFORMPROPERTY_H_
48 #define _MIRA_TRANSFORMPROPERTY_H_
49 
53 
54 #include <fw/FrameworkExports.h>
55 
56 namespace mira {
57 
59 
73 {
74 public:
75 
76  template <typename Reflector>
77  void reflect(Reflector& r) {
78  r.delegate(mID);
79  }
80 
81  bool operator==(const TransformProperty& other) const {
82  return mID == other.mID;
83  }
84 
85  bool operator!=(const TransformProperty& other) const {
86  return !operator==(other);
87  }
88 
89  TransformProperty& operator=(const std::string& s) {
90  mID = s;
91  return *this;
92  }
93 
95  const std::string& getID() const {
96  return mID;
97  }
98 
99  operator std::string() const { return mID; }
100 
101  bool isValid() const;
102 
103  bool isEmpty() const {
104  return mID.empty();
105  }
106 
107  bool empty() const {
108  return mID.empty();
109  }
110 
111 private:
112 
113  std::string mID;
114 };
115 
117 
118 template<typename SerializerTag>
119 class IsTransparentSerializable<TransformProperty,SerializerTag> : public std::true_type {};
120 
121 template<>
122 class IsObjectTrackable<TransformProperty> : public std::false_type {};
123 
125 
126 } // namespace
127 
128 #endif
bool operator==(const TransformProperty &other) const
Definition: TransformProperty.h:81
Type trait that indicates whether pointer tracking can be enabled for this type.
Definition: IsObjectTrackable.h:68
Type trait that indicates whether a type should be serialized "transparently", i.e.
Definition: IsTransparentSerializable.h:81
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
constexpr std::enable_if<!FunctionTraits< F >::isFunction, bool >::type isValid()
Definition: RPCPatternCheck.h:193
bool isEmpty() const
Definition: TransformProperty.h:103
Use this class instead of a string property whenever your module has a transform frame as property...
Definition: TransformProperty.h:72
Provides type trait that indicates whether a type should be serialized "transparently".
Provides type trait that indicates whether pointer/object tracking should be enabled for a certain ty...
Framework export macro declaration.
bool empty() const
Definition: TransformProperty.h:107
Contains the base interface of all Reflectors, Serializers, etc.
TransformProperty & operator=(const std::string &s)
Definition: TransformProperty.h:89
#define MIRA_FRAMEWORK_EXPORT
Definition: FrameworkExports.h:61
bool operator==(const ImgIteratorBase &a, const ImgIteratorBase &b)
Definition: ImgIterator.h:225
const std::string & getID() const
Returns the frame ID of this property.
Definition: TransformProperty.h:95
bool operator!=(const TransformProperty &other) const
Definition: TransformProperty.h:85
void reflect(Reflector &r)
Definition: TransformProperty.h:77