source: rrlib_rtti/tTypeAnnotation.h @ 37:01f523c173f2

Last change on this file since 37:01f523c173f2 was 37:01f523c173f2, checked in by Tobias Föhst <foehst@…>, 5 years ago

Added and updated license information

File size: 3.4 KB
Line 
1//
2// You received this file as part of RRLib
3// Robotics Research Library
4//
5// Copyright (C) Finroc GbR (finroc.org)
6//
7// This program is free software; you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation; either version 2 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License along
18// with this program; if not, write to the Free Software Foundation, Inc.,
19// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20//
21//----------------------------------------------------------------------
22/*!\file    rrlib/rtti/tTypeAnnotation.h
23 *
24 * \author  Max Reichardt
25 *
26 * \date    2012-11-02
27 *
28 * \brief   Contains tTypeAnnotation
29 *
30 * \b tTypeAnnotation
31 *
32 * Custom annotations for types should be derived from this class
33 * An instance can only be added to one type and will be deleted
34 * by/with this type.
35 *
36 */
37//----------------------------------------------------------------------
38#ifndef __rrlib__rtti__tTypeAnnotation_h__
39#define __rrlib__rtti__tTypeAnnotation_h__
40
41//----------------------------------------------------------------------
42// External includes (system with <>, local with "")
43//----------------------------------------------------------------------
44#include "rrlib/util/tNoncopyable.h"
45
46//----------------------------------------------------------------------
47// Internal includes with ""
48//----------------------------------------------------------------------
49#include "rrlib/rtti/tType.h"
50
51//----------------------------------------------------------------------
52// Namespace declaration
53//----------------------------------------------------------------------
54namespace rrlib
55{
56namespace rtti
57{
58
59//----------------------------------------------------------------------
60// Forward declarations / typedefs / enums
61//----------------------------------------------------------------------
62
63//----------------------------------------------------------------------
64// Class declaration
65//----------------------------------------------------------------------
66//! Type annotation
67/*!
68 * Custom annotations for types should be derived from this class
69 * An instance can only be added to one type and will be deleted
70 * by/with this type.
71 */
72class tTypeAnnotation : private util::tNoncopyable
73{
74
75//----------------------------------------------------------------------
76// Public methods and typedefs
77//----------------------------------------------------------------------
78public:
79
80  tTypeAnnotation() :
81    annotated_type()
82  {}
83
84  virtual ~tTypeAnnotation() {}
85
86  /*!
87   * \return Type that is annotated
88   */
89  inline tType GetAnnotatedType()
90  {
91    return annotated_type;
92  }
93
94//----------------------------------------------------------------------
95// Private fields and methods
96//----------------------------------------------------------------------
97private:
98
99  friend class tType;
100
101  /*! Type that is annotated */
102  tType annotated_type;
103
104};
105
106//----------------------------------------------------------------------
107// End of namespace declaration
108//----------------------------------------------------------------------
109}
110}
111
112
113#endif
Note: See TracBrowser for help on using the repository browser.