OTB  9.0.0
Orfeo Toolbox
grmMacroGenerator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Macro Generator used by the Generic Region Merging Library but can be used
4  for other libraries.
5  Language: C++
6  author: Lassalle Pierre
7  contact: lassallepierre34@gmail.com
8 
9 
10  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef MG_H
19 #define MG_H
20 
21 // Generate automatically get/set methods
22 #define GRMGetMacro(type, name) \
23  type Get##name() \
24  {\
25  return m_##name; \
26  }
27 
28 #define GRMSetMacro(type, name) \
29  void Set##name(type v) \
30  { \
31  m_##name = v; \
32  }
33 
34 #define GRMGetRefMacro(type, name) \
35  type& Get##name() \
36  {\
37  return m_##name; \
38  }
39 
40 #define GRMGetConstMacro(type, name) \
41  const type Get##name() \
42  {\
43  return m_##name; \
44  }
45 
46 #endif