Jpp  19.1.0-rc.1
the software that should make you happy
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
JDETECTOR::JDetectorVersion Struct Reference

Detector version. More...

#include <JDetectorVersion.hh>

Inheritance diagram for JDETECTOR::JDetectorVersion:
JDETECTOR::JVersion JLANG::JComparable< JFirst_t, JSecond_t > JDETECTOR::JDetector JDETECTOR::JMonteCarloDetector JDYNAMICS::JDynamics

Public Types

enum  JVersion_t {
  V1 = 1 , V2 = 2 , V3 = 3 , V4 = 4 ,
  V5 = 5
}
 Enumeration of version types. More...
 

Public Member Functions

 JDetectorVersion ()
 Default constructor. More...
 
 JDetectorVersion (const JVersion &version)
 Constructor. More...
 
bool hasVersion () const
 Check validity of version. More...
 
const std::string & getVersion () const
 Get version. More...
 
void setVersion (const std::string &version)
 Set version. More...
 
bool less (const JVersion &version) const
 Less-than method. More...
 

Protected Attributes

std::string version
 

Friends

std::istream & operator>> (std::istream &in, JDetectorVersion &version)
 Read version from input. More...
 
std::ostream & operator<< (std::ostream &out, const JDetectorVersion &version)
 Write version to output. More...
 
JReaderoperator>> (JReader &in, JDetectorVersion &version)
 Read version from input. More...
 
JWriteroperator<< (JWriter &out, const JDetectorVersion &version)
 Write version to output. More...
 

Detailed Description

Detector version.

Definition at line 41 of file JDetectorVersion.hh.

Member Enumeration Documentation

◆ JVersion_t

Enumeration of version types.


Note that additional version types should be included in JGetDetectorVersion::JGetDetectorVersion.

Enumerator
V1 

First version.

V2 

Version with UTC time and UTM position data.

V3 

Version with PMT status field and comments.

V4 

Version with quaternion and time offset per module.

V5 

Version with module status field.

Definition at line 48 of file JDetectorVersion.hh.

48  {
49  V1 = 1, //!< First version
50  V2 = 2, //!< Version with UTC time and UTM position data
51  V3 = 3, //!< Version with PMT status field and comments
52  V4 = 4, //!< Version with quaternion and time offset per module
53  V5 = 5 //!< Version with module status field
54  };
@ V2
Version with UTC time and UTM position data.
@ V5
Version with module status field.
@ V4
Version with quaternion and time offset per module.
@ V3
Version with PMT status field and comments.

Constructor & Destructor Documentation

◆ JDetectorVersion() [1/2]

JDETECTOR::JDetectorVersion::JDetectorVersion ( )
inline

Default constructor.

Definition at line 60 of file JDetectorVersion.hh.

60  :
61  JVersion()
62  {}
JVersion()
Default constructor.

◆ JDetectorVersion() [2/2]

JDETECTOR::JDetectorVersion::JDetectorVersion ( const JVersion version)
inline

Constructor.

Parameters
versionversion

Definition at line 70 of file JDetectorVersion.hh.

70  :
72  {}

Member Function Documentation

◆ hasVersion()

bool JDETECTOR::JDetectorVersion::hasVersion ( ) const
inline

Check validity of version.

Returns
true if valid; else false

Definition at line 80 of file JDetectorVersion.hh.

81  {
82  return (!this->version.empty() && (this->version[0] == 'v' || this->version[0] == 'V'));
83  }

◆ getVersion()

const std::string& JDETECTOR::JVersion::getVersion ( ) const
inlineinherited

Get version.

Returns
version

Definition at line 50 of file JDetector/JVersion.hh.

51  {
52  return this->version;
53  }

◆ setVersion()

void JDETECTOR::JVersion::setVersion ( const std::string &  version)
inlineinherited

Set version.

Parameters
versionversion

Definition at line 61 of file JDetector/JVersion.hh.

62  {
63  this->version = version;
64  }

◆ less()

bool JDETECTOR::JVersion::less ( const JVersion version) const
inlineinherited

Less-than method.

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

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

74  {
75  return this->getVersion() < version.getVersion();
76  }
const std::string & getVersion() const
Get version.

Friends And Related Function Documentation

◆ operator>> [1/2]

std::istream& operator>> ( std::istream &  in,
JDetectorVersion version 
)
friend

Read version from input.

Parameters
ininput stream
versionversion
Returns
input stream

Definition at line 93 of file JDetectorVersion.hh.

94  {
95  return in >> version.version;
96  }

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  out,
const JDetectorVersion version 
)
friend

Write version to output.

Parameters
outoutput stream
versionversion
Returns
output stream

Definition at line 106 of file JDetectorVersion.hh.

107  {
108  return out << version.version;
109  }

◆ operator>> [2/2]

JReader& operator>> ( JReader in,
JDetectorVersion version 
)
friend

Read version from input.

Parameters
inreader
versionversion
Returns
reader

Definition at line 119 of file JDetectorVersion.hh.

120  {
121  return in >> version.version;
122  }

◆ operator<< [2/2]

JWriter& operator<< ( JWriter out,
const JDetectorVersion version 
)
friend

Write version to output.

Parameters
outwriter
versionversion
Returns
writer

Definition at line 132 of file JDetectorVersion.hh.

133  {
134  return out << version.version;
135  }

Member Data Documentation

◆ version

std::string JDETECTOR::JVersion::version
protectedinherited

Definition at line 79 of file JDetector/JVersion.hh.


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