CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ora::Version Class Reference

#include <Version.h>

Public Member Functions

bool operator!= (const Version &rhs) const
 
bool operator< (const Version &rhs) const
 
bool operator<= (const Version &rhs) const
 
Versionoperator= (const Version &rhs)
 
bool operator== (const Version &rhs) const
 
bool operator> (const Version &rhs) const
 
bool operator>= (const Version &rhs) const
 
void toOutputStream (std::ostream &os) const
 
std::string toString () const
 
 Version ()
 
 Version (const std::string &label, int id)
 
 Version (const Version &rhs)
 
 ~Version ()
 

Static Public Member Functions

static Version fromString (const std::string &versionString)
 
static const VersionpoolSchemaVersion ()
 
static const VersionthisSchemaVersion ()
 

Private Attributes

std::string m_label
 
int m_main
 
int m_patch
 
int m_release
 

Detailed Description

Definition at line 9 of file Version.h.

Constructor & Destructor Documentation

Version::Version ( )

Definition at line 31 of file Version.cc.

31  :
32  m_label(""),
33  m_main( -999 ),
34  m_release( 0 ),
35  m_patch( 0 ){
36 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
std::string m_label
Definition: Version.h:35
int m_patch
Definition: Version.h:38
Version::Version ( const std::string &  label,
int  id 
)

Definition at line 38 of file Version.cc.

38  :
39  m_label( label ),
40  m_main( id ),
41  m_release( 0 ),
42  m_patch( 0 ){
43 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
std::string m_label
Definition: Version.h:35
int m_patch
Definition: Version.h:38
ora::Version::~Version ( )
inline

Definition at line 19 of file Version.h.

19  {
20  }
Version::Version ( const Version rhs)

Definition at line 45 of file Version.cc.

45  :
46  m_label( rhs.m_label ),
47  m_main( rhs.m_main ),
48  m_release( rhs.m_release ),
49  m_patch( rhs.m_patch ){
50 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
std::string m_label
Definition: Version.h:35
int m_patch
Definition: Version.h:38

Member Function Documentation

ora::Version Version::fromString ( const std::string &  versionString)
static

Definition at line 21 of file Version.cc.

References fmt, m_label, m_main, m_patch, m_release, AlCaHLTBitMon_ParallelJobs::p, ora::poolSchemaVersion(), poolSchemaVersionLabel, source, AlCaHLTBitMon_QueryRunRegistry::string, and tmp.

Referenced by cond::DbSession::isOldSchema(), and ora::Database::schemaVersion().

21  {
23  Version ver;
24  ver.m_label = source;
26  char* p = (char*)tmp.c_str();
27  ::sscanf(p, fmt, &ver.m_main, &ver.m_release, &ver.m_patch );
28  return ver;
29 }
static const char * fmt
Definition: Version.cc:9
static const Version & poolSchemaVersion()
Definition: Version.cc:11
static const char * poolSchemaVersionLabel
Definition: Version.cc:8
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
static std::string const source
Definition: EdmProvDump.cc:43
bool Version::operator!= ( const Version rhs) const

Definition at line 64 of file Version.cc.

References operator==().

64  {
65  return !operator==( rhs );
66 }
bool operator==(const Version &rhs) const
Definition: Version.cc:60
bool Version::operator< ( const Version rhs) const

Definition at line 79 of file Version.cc.

References m_main, m_patch, and m_release.

79  {
80  if( m_main < rhs.m_main ) return true;
81  if( m_main == rhs.m_main ){
82  if( m_release < rhs.m_release ) return true;
83  if( m_release == rhs.m_release ){
84  if(m_patch < rhs.m_patch ) return true;
85  }
86  }
87  return false;
88 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
int m_patch
Definition: Version.h:38
bool Version::operator<= ( const Version rhs) const

Definition at line 101 of file Version.cc.

References m_main, m_patch, and m_release.

101  {
102  if( m_main <= rhs.m_main ) return true;
103  if( m_main == rhs.m_main ){
104  if( m_release <= rhs.m_release ) return true;
105  if( m_release == rhs.m_release ){
106  if(m_patch <= rhs.m_patch ) return true;
107  }
108  }
109  return false;
110 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
int m_patch
Definition: Version.h:38
ora::Version & Version::operator= ( const Version rhs)

Definition at line 52 of file Version.cc.

References m_label, m_main, m_patch, and m_release.

52  {
53  m_label = rhs.m_label;
54  m_main = rhs.m_main;
55  m_release = rhs.m_release;
56  m_patch = rhs.m_patch;
57  return *this;
58 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
std::string m_label
Definition: Version.h:35
int m_patch
Definition: Version.h:38
bool Version::operator== ( const Version rhs) const

Definition at line 60 of file Version.cc.

References m_main, m_patch, and m_release.

60  {
61  return m_main == rhs.m_main && m_release == rhs.m_release && m_patch == rhs.m_patch;
62 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
int m_patch
Definition: Version.h:38
bool Version::operator> ( const Version rhs) const

Definition at line 68 of file Version.cc.

References m_main, m_patch, and m_release.

68  {
69  if( m_main > rhs.m_main ) return true;
70  if( m_main == rhs.m_main ){
71  if( m_release > rhs.m_release ) return true;
72  if( m_release == rhs.m_release ){
73  if(m_patch > rhs.m_patch ) return true;
74  }
75  }
76  return false;
77 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
int m_patch
Definition: Version.h:38
bool Version::operator>= ( const Version rhs) const

Definition at line 90 of file Version.cc.

References m_main, m_patch, and m_release.

90  {
91  if( m_main >= rhs.m_main ) return true;
92  if( m_main == rhs.m_main ){
93  if( m_release >= rhs.m_release ) return true;
94  if( m_release == rhs.m_release ){
95  if(m_patch >= rhs.m_patch ) return true;
96  }
97  }
98  return false;
99 }
int m_release
Definition: Version.h:37
int m_main
Definition: Version.h:36
int m_patch
Definition: Version.h:38
const ora::Version & Version::poolSchemaVersion ( )
static

Definition at line 11 of file Version.cc.

References poolSchemaVersionLabel, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cond::DbSession::isOldSchema().

11  {
12  static const Version s_ver( std::string(poolSchemaVersionLabel), -1 );
13  return s_ver;
14 }
static const char * poolSchemaVersionLabel
Definition: Version.cc:8
const ora::Version & Version::thisSchemaVersion ( )
static

Definition at line 16 of file Version.cc.

References pat::helper::ParametrizationHelper::fromString(), AlCaHLTBitMon_QueryRunRegistry::string, and thisSchemaVersionLabel.

16  {
17  static const Version s_ver = fromString( std::string( thisSchemaVersionLabel ));
18  return s_ver;
19 }
static Version fromString(const std::string &versionString)
Definition: Version.cc:21
static const char * thisSchemaVersionLabel
Definition: Version.cc:6
void Version::toOutputStream ( std::ostream &  os) const

Definition at line 116 of file Version.cc.

Referenced by operator<<().

116  {
117  os << m_label;
118 }
std::string m_label
Definition: Version.h:35
std::string Version::toString ( ) const

Definition at line 112 of file Version.cc.

112  {
113  return m_label;
114 }
std::string m_label
Definition: Version.h:35

Member Data Documentation

std::string ora::Version::m_label
private

Definition at line 35 of file Version.h.

Referenced by fromString(), and operator=().

int ora::Version::m_main
private

Definition at line 36 of file Version.h.

Referenced by fromString(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().

int ora::Version::m_patch
private

Definition at line 38 of file Version.h.

Referenced by fromString(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().

int ora::Version::m_release
private

Definition at line 37 of file Version.h.

Referenced by fromString(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().