Jpp  test_elongated_shower_pde
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 | Friends | List of all members
JEEP::JVersion Struct Reference

Auxiliary data structure for general purpose version number. More...

#include <JVersion.hh>

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

Public Types

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

Public Member Functions

 JVersion ()
 Default constructor. More...
 
 JVersion (const version_type major, const version_type minor, const version_type patch)
 Constructor. 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...
 

Friends

std::istream & operator>> (std::istream &in, JVersion &object)
 Read version from input stream. More...
 
std::ostream & operator<< (std::ostream &out, const JVersion &object)
 Write version to output stream. More...
 

Detailed Description

Auxiliary data structure for general purpose version number.

A version consists of a major, minor and patch number.
The I/O format is <major>.<minor>.<patch>.

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

Member Typedef Documentation

typedef unsigned int JEEP::JVersion::version_type

Type definition of [sub-]versions.

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

Constructor & Destructor Documentation

JEEP::JVersion::JVersion ( )
inline

Default constructor.

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

45  :
46  majorVersion(0),
47  minorVersion(0),
48  patchVersion(0)
49  {}
version_type minorVersion
minor version
version_type majorVersion
major version
version_type patchVersion
patch version
JEEP::JVersion::JVersion ( const version_type  major,
const version_type  minor,
const version_type  patch 
)
inline

Constructor.

Parameters
majormajor version
minorminor version
patchpatch version

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

61  :
62  majorVersion(major),
63  minorVersion(minor),
64  patchVersion(patch)
65  {}
version_type minorVersion
minor version
version_type majorVersion
major version
version_type patchVersion
patch version

Member Function Documentation

version_type JEEP::JVersion::getMajorVersion ( ) const
inline

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
inline

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
inline

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
inline

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

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JVersion object 
)
friend

Read version from input stream.

Parameters
ininput stream
objectversion
Returns
input stream

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

135  {
136  using namespace std;
137 
139 
140  if (in >> version) {
141  object.majorVersion = version;
142  } else {
143  in.setstate(ios::failbit);
144  }
145 
146  if ((in.peek() == (int) JVersion::SEPARATOR) && (in.ignore() && in >> version)) {
147  object.minorVersion = version;
148  } else {
149  in.setstate(ios::failbit);
150  }
151 
152  if ((in.peek() == (int) JVersion::SEPARATOR) && (in.ignore() && in >> version)) {
153  object.patchVersion = version;
154  } else {
155  in.setstate(ios::failbit);
156  }
157 
158  return in;
159  }
static const char SEPARATOR
Separator between [sub-]versions.
unsigned int version_type
Type definition of [sub-]versions.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
version
Definition: JCalibratePMT.sh:7
std::ostream& operator<< ( std::ostream &  out,
const JVersion object 
)
friend

Write version to output stream.

Parameters
outoutput stream
objectversion
Returns
output stream

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

170  {
171  return out <<
172  object.majorVersion << JVersion::SEPARATOR <<
173  object.minorVersion << JVersion::SEPARATOR <<
174  object.patchVersion;
175  }
static const char SEPARATOR
Separator between [sub-]versions.

Member Data Documentation

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

Separator between [sub-]versions.

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

version_type JEEP::JVersion::majorVersion
protected

major version

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

version_type JEEP::JVersion::minorVersion
protected

minor version

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

version_type JEEP::JVersion::patchVersion
protected

patch version

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


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