Jpp  18.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDetector/JVersion.hh
Go to the documentation of this file.
1 #ifndef __JDETECTOR__JVERSION__
2 #define __JDETECTOR__JVERSION__
3 
4 #include <string>
5 
6 #include "JLang/JComparable.hh"
7 
8 
9 /**
10  * \author mdejong
11  */
12 
13 namespace JDETECTOR {}
14 namespace JPP { using namespace JDETECTOR; }
15 
16 namespace JDETECTOR {
17 
18  using JLANG::JComparable;
19 
20 
21  /**
22  * Auxiliary class for version identifier.
23  */
24  struct JVersion :
25  public JComparable<JVersion>
26  {
27  /**
28  * Default constructor.
29  */
31  version()
32  {}
33 
34 
35  /**
36  * Constructor.
37  *
38  * \param version version
39  */
41  version(version)
42  {}
43 
44 
45  /**
46  * Get version.
47  *
48  * \return version
49  */
50  const std::string& getVersion() const
51  {
52  return this->version;
53  }
54 
55 
56  /**
57  * Set version.
58  *
59  * \param version version
60  */
62  {
63  this->version = version;
64  }
65 
66 
67  /**
68  * Less-than method.
69  *
70  * \param version version
71  * \result true if this version less than given version; else false
72  */
73  inline bool less(const JVersion& version) const
74  {
75  return this->getVersion() < version.getVersion();
76  }
77 
78  protected:
80  };
81 }
82 
83 #endif
JVersion()
Default constructor.
JVersion(const std::string &version)
Constructor.
const std::string & getVersion() const
Get version.
void setVersion(const std::string &version)
Set version.
then awk string
Template definition of auxiliary base class for comparison of data structures.
Definition: JComparable.hh:24
Auxiliary class for version identifier.
bool less(const JVersion &version) const
Less-than method.