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 Version &rhs)
 
 ~Version ()
 

Static Public Member Functions

static Version fromString (const std::string &versionString)
 
static VersionpoolSchemaVersion ()
 
static 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 34 of file Version.cc.

34  :
35  m_label(""),
36  m_main( -999 ),
37  m_release( 0 ),
38  m_patch( 0 ){
39 }
int m_release
Definition: Version.h:36
int m_main
Definition: Version.h:35
std::string m_label
Definition: Version.h:34
int m_patch
Definition: Version.h:37
ora::Version::~Version ( )
inline

Definition at line 18 of file Version.h.

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

Definition at line 41 of file Version.cc.

41  :
42  m_label( rhs.m_label ),
43  m_main( rhs.m_main ),
44  m_release( rhs.m_release ),
45  m_patch( rhs.m_patch ){
46 }
int m_release
Definition: Version.h:36
int m_main
Definition: Version.h:35
std::string m_label
Definition: Version.h:34
int m_patch
Definition: Version.h:37

Member Function Documentation

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

Definition at line 24 of file Version.cc.

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

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

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

Definition at line 60 of file Version.cc.

References operator==().

60  {
61  return !operator==( rhs );
62 }
bool operator==(const Version &rhs) const
Definition: Version.cc:56
bool Version::operator< ( const Version rhs) const

Definition at line 75 of file Version.cc.

References m_main, m_patch, and m_release.

75  {
76  if( m_main < rhs.m_main ) return true;
77  if( m_main == rhs.m_main ){
78  if( m_release < rhs.m_release ) return true;
79  if( m_release == rhs.m_release ){
80  if(m_patch < rhs.m_patch ) return true;
81  }
82  }
83  return false;
84 }
int m_release
Definition: Version.h:36
int m_main
Definition: Version.h:35
int m_patch
Definition: Version.h:37
bool Version::operator<= ( const Version rhs) const

Definition at line 97 of file Version.cc.

References m_main, m_patch, and m_release.

97  {
98  if( m_main <= rhs.m_main ) return true;
99  if( m_main == rhs.m_main ){
100  if( m_release <= rhs.m_release ) return true;
101  if( m_release == rhs.m_release ){
102  if(m_patch <= rhs.m_patch ) return true;
103  }
104  }
105  return false;
106 }
int m_release
Definition: Version.h:36
int m_main
Definition: Version.h:35
int m_patch
Definition: Version.h:37
ora::Version & Version::operator= ( const Version rhs)

Definition at line 48 of file Version.cc.

References m_label, m_main, m_patch, and m_release.

48  {
49  m_label = rhs.m_label;
50  m_main = rhs.m_main;
51  m_release = rhs.m_release;
52  m_patch = rhs.m_patch;
53  return *this;
54 }
int m_release
Definition: Version.h:36
int m_main
Definition: Version.h:35
std::string m_label
Definition: Version.h:34
int m_patch
Definition: Version.h:37
bool Version::operator== ( const Version rhs) const

Definition at line 56 of file Version.cc.

References m_main, m_patch, and m_release.

56  {
57  return m_main == rhs.m_main && m_release == rhs.m_release && m_patch == rhs.m_patch;
58 }
int m_release
Definition: Version.h:36
int m_main
Definition: Version.h:35
int m_patch
Definition: Version.h:37
bool Version::operator> ( const Version rhs) const

Definition at line 64 of file Version.cc.

References m_main, m_patch, and m_release.

64  {
65  if( m_main > rhs.m_main ) return true;
66  if( m_main == rhs.m_main ){
67  if( m_release > rhs.m_release ) return true;
68  if( m_release == rhs.m_release ){
69  if(m_patch > rhs.m_patch ) return true;
70  }
71  }
72  return false;
73 }
int m_release
Definition: Version.h:36
int m_main
Definition: Version.h:35
int m_patch
Definition: Version.h:37
bool Version::operator>= ( const Version rhs) const

Definition at line 86 of file Version.cc.

References m_main, m_patch, and m_release.

86  {
87  if( m_main >= rhs.m_main ) return true;
88  if( m_main == rhs.m_main ){
89  if( m_release >= rhs.m_release ) return true;
90  if( m_release == rhs.m_release ){
91  if(m_patch >= rhs.m_patch ) return true;
92  }
93  }
94  return false;
95 }
int m_release
Definition: Version.h:36
int m_main
Definition: Version.h:35
int m_patch
Definition: Version.h:37
ora::Version & Version::poolSchemaVersion ( )
static

Definition at line 11 of file Version.cc.

References m_label, m_main, and poolSchemaVersionLabel.

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

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

Definition at line 18 of file Version.cc.

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

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

Definition at line 112 of file Version.cc.

Referenced by operator<<().

112  {
113  os << m_label;
114 }
std::string m_label
Definition: Version.h:34
std::string Version::toString ( ) const

Definition at line 108 of file Version.cc.

108  {
109  return m_label;
110 }
std::string m_label
Definition: Version.h:34

Member Data Documentation

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

Definition at line 34 of file Version.h.

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

int ora::Version::m_main
private
int ora::Version::m_patch
private

Definition at line 37 of file Version.h.

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

int ora::Version::m_release
private

Definition at line 36 of file Version.h.

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