GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GTypemaps.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GTypemaps.hpp - GammaLib typemaps *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2013-2014 by Juergen Knoedlseder *
5  * ----------------------------------------------------------------------- *
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 3 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 *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file GTypemaps.hpp
23  * @brief Definition of GammaLib typemaps
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GTYPEMAPS_HPP
28 #define GTYPEMAPS_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 
32 /* __ Chatter level enumerations _________________________________________ */
33 typedef enum {
34  SILENT = 0,
35  TERSE = 1,
36  NORMAL = 2,
37  EXPLICIT = 3,
38  VERBOSE = 4
39 } GChatter;
40 
41 /* __ Class code enumerations (used primarily to avoid dynamic casting) __ */
42 typedef enum {
48 } GClassCode;
49 
50 /* __ Typemaps ___________________________________________________________ */
51 
52 /* __ Prototypes _________________________________________________________ */
53 namespace gammalib {
54  GChatter reduce(const GChatter& chatter);
55 }
56 
57 
58 /***********************************************************************//**
59  * @brief Reduce chattiness by one level
60  *
61  * @param[in] chatter Chattiness.
62  * @return Reduced chattiness.
63  ***************************************************************************/
64 inline
66 {
67  // Allocate reduced chattiness
68  GChatter reduced;
69 
70  // Reduce chattiness
71  switch (chatter) {
72  case SILENT:
73  reduced = SILENT;
74  break;
75  case TERSE:
76  reduced = SILENT;
77  break;
78  case NORMAL:
79  reduced = TERSE;
80  break;
81  case EXPLICIT:
82  reduced = NORMAL;
83  break;
84  case VERBOSE:
85  reduced = EXPLICIT;
86  break;
87  default:
88  reduced = chatter;
89  break;
90  }
91 
92  // Return reduced chattiness
93  return reduced;
94 }
95 
96 #endif /* GTYPEMAPS_HPP */
GChatter
Definition: GTypemaps.hpp:33
GClassCode
Definition: GTypemaps.hpp:42
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
Definition: GTypemaps.hpp:65