BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
Version.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file eformat/Version.h
5 * @author <a href="mailto:[email protected]">Andre DOS ANJOS</a>
6 * $Author: zhangy $
7 * $Revision: 1.1.1.1 $
8 * $Date: 2009/06/19 07:35:41 $
9 *
10 * @brief Defines a helper class to encode and decode version numbers.
11 */
12
13#ifndef EFORMAT_VERSION_H
14#define EFORMAT_VERSION_H
15
16#include <stdint.h>
17#include <string>
18
19namespace eformat {
20
21 /**
22 * The default eformat version to use
23 */
24 const uint32_t DEFAULT_VERSION = 0x03000000;
25
26 /**
27 * The major default eformat version to use
28 */
29 const uint16_t MAJOR_DEFAULT_VERSION = 0x0300;
30
31 /**
32 * The major default eformat version to use
33 */
34 const uint16_t MAJOR_OLD_VERSION = 0x0204;
35
36 namespace helper {
37
38 /**
39 * Defines converters between version numbers and its components
40 */
41 class Version {
42
43 public:
44 /**
45 * Constructor. Takes the components to form a version
46 *
47 * @param minor The minor version
48 * @param major The major version
49 */
50 Version (uint16_t minor, uint16_t major=MAJOR_DEFAULT_VERSION)
51 : m_minor(minor), m_major(major) {}
52
53 /**
54 * Constructor. Takes the version to understand the components from.
55 *
56 * @param v The version number, fully built.
57 * @warning This version number <b>has</b> to conform to the current
58 * version of the library or unpredictable results might occur.
59 */
60 Version (uint32_t v=DEFAULT_VERSION);
61
62 /**
63 * Extracts the major version part of this version
64 */
65 inline uint16_t major2 (void) const { return m_major; }
66
67 /**
68 * Extracts the minor version part of this version
69 */
70 inline uint16_t minor2 (void) const { return m_minor; }
71
72 /**
73 * Gets the full 32-bit number made by assembling the 2 numbers
74 * above.
75 */
76 uint32_t code (void) const;
77
78 /**
79 * Returns a string representation of the major version number
80 */
81 std::string human_major (void) const;
82
83 /**
84 * Returns a string representation of the minor version number
85 */
86 std::string human_minor (void) const;
87
88 /**
89 * Returns a string representation of the version number
90 */
91 std::string human (void) const;
92
93 private: //representation
94
95 uint16_t m_minor; ///< The minor part of the version number
96 uint16_t m_major; ///< The major part of the version number
97
98 };
99
100 }
101
102}
103
104#endif /* EFORMAT_VERSION_H */
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
std::string human_major(void) const
Definition: Version.cxx:29
std::string human_minor(void) const
Definition: Version.cxx:36
uint16_t minor2(void) const
Definition: Version.h:70
std::string human(void) const
Definition: Version.cxx:43
uint16_t major2(void) const
Definition: Version.h:65
Version(uint16_t minor, uint16_t major=MAJOR_DEFAULT_VERSION)
Definition: Version.h:50
uint32_t code(void) const
Definition: Version.cxx:21
const uint32_t DEFAULT_VERSION
Definition: Version.h:24
const uint16_t MAJOR_OLD_VERSION
Definition: Version.h:34
const uint16_t MAJOR_DEFAULT_VERSION
Definition: Version.h:29