BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
eformat::helper::Version Class Reference

#include <Version.h>

Public Member Functions

 Version (uint16_t minor, uint16_t major=MAJOR_DEFAULT_VERSION)
 
 Version (uint32_t v=DEFAULT_VERSION)
 
uint16_t major2 (void) const
 
uint16_t minor2 (void) const
 
uint32_t code (void) const
 
std::string human_major (void) const
 
std::string human_minor (void) const
 
std::string human (void) const
 

Detailed Description

Defines converters between version numbers and its components

Definition at line 41 of file Version.h.

Constructor & Destructor Documentation

◆ Version() [1/2]

eformat::helper::Version::Version ( uint16_t  minor,
uint16_t  major = MAJOR_DEFAULT_VERSION 
)
inline

Constructor. Takes the components to form a version

Parameters
minorThe minor version
majorThe major version

Definition at line 50 of file Version.h.

51 : m_minor(minor), m_major(major) {}

◆ Version() [2/2]

eformat::helper::Version::Version ( uint32_t  v = DEFAULT_VERSION)

Constructor. Takes the version to understand the components from.

Parameters
vThe version number, fully built.
Warning
This version number has to conform to the current version of the library or unpredictable results might occur.

Definition at line 16 of file Version.cxx.

17 : m_minor(0xffff&v), m_major(v>>16)
18{
19}
**********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

Member Function Documentation

◆ code()

uint32_t eformat::helper::Version::code ( void  ) const

Gets the full 32-bit number made by assembling the 2 numbers above.

Definition at line 21 of file Version.cxx.

22{
23 uint32_t retval = m_major;
24 retval <<= 16;
25 retval |= m_minor;
26 return retval;
27}

◆ human()

std::string eformat::helper::Version::human ( void  ) const

Returns a string representation of the version number

Definition at line 43 of file Version.cxx.

44{
45 std::string retval = human_major();
46 retval += "-";
47 retval += human_minor();
48 return retval;
49}
std::string human_major(void) const
Definition: Version.cxx:29
std::string human_minor(void) const
Definition: Version.cxx:36

◆ human_major()

std::string eformat::helper::Version::human_major ( void  ) const

Returns a string representation of the major version number

Definition at line 29 of file Version.cxx.

30{
31 std::ostringstream oss;
32 oss << (major2() >> 8) << "." << (major2() & 0xff);
33 return oss.str();
34}
uint16_t major2(void) const
Definition: Version.h:65

◆ human_minor()

std::string eformat::helper::Version::human_minor ( void  ) const

Returns a string representation of the minor version number

Definition at line 36 of file Version.cxx.

37{
38 std::ostringstream oss;
39 oss << (minor2() >> 8) << "." << (minor2() & 0xff);
40 return oss.str();
41}
uint16_t minor2(void) const
Definition: Version.h:70

◆ major2()

uint16_t eformat::helper::Version::major2 ( void  ) const
inline

Extracts the major version part of this version

Definition at line 65 of file Version.h.

65{ return m_major; }

Referenced by eformat::old::convert(), and convert_ros().

◆ minor2()

uint16_t eformat::helper::Version::minor2 ( void  ) const
inline

Extracts the minor version part of this version

Definition at line 70 of file Version.h.

70{ return m_minor; }

Referenced by eformat::old::convert(), and convert_ros().


The documentation for this class was generated from the following files: