Jpp  15.0.4
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
JDATABASE::JDBAPIVersion Struct Reference

Auxiliary data structure for I/O of database API versions. More...

#include <JDBSupportkit.hh>

Inheritance diagram for JDATABASE::JDBAPIVersion:
JEEP::JVersion JLANG::JComparable< JFirst_t, JSecond_t > JLANG::JComparable< JFirst_t, JSecond_t >

Public Types

typedef unsigned int version_type
 Type definition of [sub-]versions. More...
 

Public Member Functions

 JDBAPIVersion ()
 Default constructor. More...
 
 JDBAPIVersion (const int major, const int minor, const int patch)
 Constructor. More...
 
bool is_valid () const
 Check validity. More...
 
version_type getMajorVersion () const
 Get major version. More...
 
version_type getMinorVersion () const
 Get minor version. More...
 
version_type getPatchVersion () const
 Get patch version. More...
 
bool less (const JVersion &version) const
 Compare version. More...
 

Static Public Attributes

static const char SEPARATOR = '.'
 Separator between [sub-]versions. More...
 

Protected Attributes

version_type majorVersion
 major version More...
 
version_type minorVersion
 minor version More...
 
version_type patchVersion
 patch version More...
 

Detailed Description

Auxiliary data structure for I/O of database API versions.

Definition at line 135 of file JDBSupportkit.hh.

Member Typedef Documentation

typedef unsigned int JEEP::JVersion::version_type
inherited

Type definition of [sub-]versions.

Definition at line 33 of file Jeep/JVersion.hh.

Constructor & Destructor Documentation

JDATABASE::JDBAPIVersion::JDBAPIVersion ( )
inline

Default constructor.

Definition at line 142 of file JDBSupportkit.hh.

142  :
143  JVersion()
144  {}
JVersion()
Default constructor.
JDATABASE::JDBAPIVersion::JDBAPIVersion ( const int  major,
const int  minor,
const int  patch 
)
inline

Constructor.

Parameters
majormajor version
minorminor version
patchpatch version

Definition at line 154 of file JDBSupportkit.hh.

156  :
157  JVersion(major, minor, patch)
158  {}
JVersion()
Default constructor.

Member Function Documentation

bool JDATABASE::JDBAPIVersion::is_valid ( ) const
inline

Check validity.

Returns
true if valid; else false

Definition at line 166 of file JDBSupportkit.hh.

167  {
168  using namespace std;
169 
170  static const set<JVersion> versions{ JVersion(1, 0, 0),
171  JVersion(2, 0, 0) };
172 
173  for (set<JVersion>::const_iterator i = versions.cbegin(); i != versions.cend(); ++i) {
174 
175  if (i->getMajorVersion() == this->getMajorVersion() &&
176  i->getMinorVersion() == this->getMinorVersion() &&
177  i->getPatchVersion() == this->getPatchVersion()) {
178 
179  return true;
180  }
181  }
182 
183  return false;
184  }
version_type getMajorVersion() const
Get major version.
JVersion()
Default constructor.
version_type getMinorVersion() const
Get minor version.
version_type getPatchVersion() const
Get patch version.
version_type JEEP::JVersion::getMajorVersion ( ) const
inlineinherited

Get major version.

Returns
major version.

Definition at line 73 of file Jeep/JVersion.hh.

74  {
75  return majorVersion;
76  }
version_type majorVersion
major version
version_type JEEP::JVersion::getMinorVersion ( ) const
inlineinherited

Get minor version.

Returns
minor version.

Definition at line 84 of file Jeep/JVersion.hh.

85  {
86  return minorVersion;
87  }
version_type minorVersion
minor version
version_type JEEP::JVersion::getPatchVersion ( ) const
inlineinherited

Get patch version.

Returns
patch version.

Definition at line 95 of file Jeep/JVersion.hh.

96  {
97  return patchVersion;
98  }
version_type patchVersion
patch version
bool JEEP::JVersion::less ( const JVersion version) const
inlineinherited

Compare version.

Parameters
versionversion
Returns
true if this version is less than given version; else false

Definition at line 107 of file Jeep/JVersion.hh.

108  {
109  if (this->majorVersion == version.majorVersion) {
110 
111  if (this->minorVersion == version.minorVersion) {
112 
113  return this->patchVersion < version.patchVersion;
114 
115  } else {
116 
117  return this->minorVersion < version.minorVersion;
118  }
119 
120  } else {
121 
122  return this->majorVersion < version.majorVersion;
123  }
124  }
version_type minorVersion
minor version
version_type majorVersion
major version
version_type patchVersion
patch version

Member Data Documentation

const char JEEP::JVersion::SEPARATOR = '.'
staticinherited

Separator between [sub-]versions.

Definition at line 39 of file Jeep/JVersion.hh.

version_type JEEP::JVersion::majorVersion
protectedinherited

major version

Definition at line 180 of file Jeep/JVersion.hh.

version_type JEEP::JVersion::minorVersion
protectedinherited

minor version

Definition at line 181 of file Jeep/JVersion.hh.

version_type JEEP::JVersion::patchVersion
protectedinherited

patch version

Definition at line 182 of file Jeep/JVersion.hh.


The documentation for this struct was generated from the following file: