eformat::helper::Version Class Reference

#include <Version.h>

List of all members.

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

Private Attributes

uint16_t m_minor
 The minor part of the version number.
uint16_t m_major
 The major part of the version number.


Detailed Description

Defines converters between version numbers and its components

Definition at line 41 of file Version.h.


Constructor & Destructor Documentation

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

Constructor. Takes the components to form a version

Parameters:
minor The minor version
major The major version

Definition at line 50 of file Version.h.

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

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

Constructor. Takes the version to understand the components from.

Parameters:
v The 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.

00017   : m_minor(0xffff&v), m_major(v>>16)
00018 {
00019 }


Member Function Documentation

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.

References m_major, and m_minor.

00022 {
00023   uint32_t retval = m_major;
00024   retval <<= 16;
00025   retval |= m_minor;
00026   return retval;
00027 }

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

Returns a string representation of the version number

Definition at line 43 of file Version.cxx.

References human_major(), human_minor(), and deljobs::string.

00044 {
00045   std::string retval = human_major();
00046   retval += "-";
00047   retval += human_minor();
00048   return retval;
00049 }

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.

References major2().

Referenced by human().

00030 {
00031   std::ostringstream oss;
00032   oss << (major2() >> 8) << "." << (major2() & 0xff);
00033   return oss.str();
00034 }

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.

References minor2().

Referenced by human().

00037 {
00038   std::ostringstream oss;
00039   oss << (minor2() >> 8) << "." << (minor2() & 0xff);
00040   return oss.str();
00041 }

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.

References m_major.

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

00065 { return m_major; }

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.

References m_minor.

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

00070 { return m_minor; }


Member Data Documentation

uint16_t eformat::helper::Version::m_major [private]

The major part of the version number.

Definition at line 96 of file Version.h.

Referenced by code(), and major2().

uint16_t eformat::helper::Version::m_minor [private]

The minor part of the version number.

Definition at line 95 of file Version.h.

Referenced by code(), and minor2().


Generated on Tue Nov 29 23:36:30 2016 for BOSS_7.0.2 by  doxygen 1.4.7