Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Jpp.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JPP__
2 #define __JLANG__JPP__
3 
4 
5 /**
6  * \file
7  *
8  * Jpp environment information.
9  *
10  * \author mdejong
11  */
12 
13 namespace KM3NET {} //!< Name space for %KM3NeT
14 namespace ANTARES {} //!< Name space for %Antares
15 
16 namespace JLANG {}
17 
18 /**
19  * This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
20  */
21 namespace JPP { using namespace JLANG; }
22 
23 namespace JLANG {
24 
25  /**
26  * Get namespace.
27  *
28  * \return namespace
29  */
30  inline const char* getNamespace()
31  {
32 #define KM3NET 1
33 #define KM3NET_HIGHQE 2
34 #define ANTARES 3
35 
36 #if NAMESPACE == ANTARES
37  return "ANTARES";
38 #elif NAMESPACE == KM3NET
39  return "KM3NET";
40 #elif NAMESPACE == KM3NET_HIGHQE
41  return "KM3NET_HIGHQE";
42 #else
43  return "?";
44 #endif
45 
46 #undef KM3NET
47 #undef KM3NET_HIGHQE
48 #undef ANTARES
49  }
50 
51 
52  /**
53  * Get GIT version.
54  *
55  * \return GIT version
56  */
57  inline const char* getGITVersion()
58  {
59 #ifdef GIT_VERSION
60  return GIT_VERSION;
61 #else
62  return "?";
63 #endif
64  }
65 
66 
67  /**
68  * Get GIT commit.
69  *
70  * \return GIT commit
71  */
72  inline const char* getGITCommit()
73  {
74 #ifdef GIT_COMMIT
75  return GIT_COMMIT;
76 #else
77  return "?";
78 #endif
79  }
80 
81 
82  /**
83  * Get GIT date.
84  *
85  * \return GIT date
86  */
87  inline const char* getGITDate()
88  {
89 #ifdef GIT_DATE
90  return GIT_DATE;
91 #else
92  return "?";
93 #endif
94  }
95 
96 
97  /**
98  * Get source.
99  *
100  * \return source
101  */
102  inline const char* getSource()
103  {
104 #ifdef SOURCE
105  return SOURCE;
106 #else
107  return "?";
108 #endif
109  }
110 }
111 
112 #endif
#define ANTARES
const char * getGITCommit()
Get GIT commit.
Definition: Jpp.hh:72
const char * getGITDate()
Get GIT date.
Definition: Jpp.hh:87
std::string getNamespace(const std::string &type_name)
Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR.
Definition: JeepToolkit.hh:225
#define KM3NET
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
const char * getSource()
Get source.
Definition: Jpp.hh:102