MRPT  1.9.9
xsversion.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef XSVERSION_H
10 #define XSVERSION_H
11 
12 #include "xstypesconfig.h"
13 #include "xsstring.h"
14 
15 typedef struct XsVersion XsVersion;
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #else
20 #define XSVERSION_INITIALIZER \
21  { \
22  0, 0, 0, 0, XsString_INITIALIZER \
23  }
24 #endif
25 
26 XSTYPES_DLL_API int XsVersion_empty(const XsVersion* thisPtr);
28  const XsVersion* thisPtr, XsString* version);
29 
30 #ifdef __cplusplus
31 } // extern "C"
32 #endif
33 
34 struct XsVersion
35 {
36 #ifdef __cplusplus
37  //! \brief Constructs a version object using the supplied parameters or an
38  //! empty version object if no parameters are given.
39  explicit XsVersion(
40  int maj = 0, int min = 0, int rev = 0, int bld = 0,
41  const XsString& extra = XsString())
42  : m_major(maj),
43  m_minor(min),
44  m_revision(rev),
45  m_build(bld),
46  m_extra(extra)
47  {
48  }
49 
50  //! \brief Constructs a version object based upon the \a other object
51  XsVersion(const XsVersion& other)
52  : m_major(other.m_major),
53  m_minor(other.m_minor),
54  m_revision(other.m_revision),
55  m_build(other.m_build),
56  m_extra(other.m_extra)
57  {
58  }
59 
60  //! \brief Assign the version from the \a other object
61  XsVersion& operator=(const XsVersion& other)
62  {
63  m_major = other.m_major;
64  m_minor = other.m_minor;
65  m_revision = other.m_revision;
66  m_build = other.m_build;
67  m_extra = other.m_extra;
68  return *this;
69  }
70 
71  //! \brief \copybrief XsVersion_empty
72  inline bool empty() const { return 0 != XsVersion_empty(this); }
73  //! \brief \copybrief XsVersion_toString
74  inline XsString toString() const
75  {
76  XsString tmp;
77  XsVersion_toString(this, &tmp);
78  return tmp;
79  }
80 
81  //! \brief Return the \e major part of the version
82  inline int major() const { return m_major; }
83  //! \brief Return the \e minor part of the version
84  inline int minor() const { return m_minor; }
85  //! \brief Return the \e revision part of the version
86  inline int revision() const { return m_revision; }
87  //! \brief Return the \e build \e number part of the version
88  inline int build() const { return m_build; }
89  //! \brief Return the extra part of the version. This may contain custom
90  //! version details such as 'beta' or 'Mk4' to indicate the readiness and
91  //! purpose of this version of the object.
92  inline XsString extra() const { return m_extra; }
93  private:
94 #endif
95 
96  /** The major part of the version number */
97  int m_major;
98  /** The minor part of the version number */
99  int m_minor;
100  /** The revision number of the version */
102  /** The build number of the version */
103  int m_build;
104  /** Storage for some extra information about the version */
106 };
107 
108 #endif // file guard
XsString m_extra
Storage for some extra information about the version.
Definition: xsversion.h:105
EIGEN_STRONG_INLINE bool empty() const
#define min(a, b)
struct XsVersion XsVersion
Definition: xsversion.h:15
int m_major
The major part of the version number.
Definition: xsversion.h:97
XSTYPES_DLL_API int XsVersion_empty(const XsVersion *thisPtr)
int m_minor
The minor part of the version number.
Definition: xsversion.h:99
int m_revision
The revision number of the version.
Definition: xsversion.h:101
#define XSTYPES_DLL_API
Definition: xstypesconfig.h:9
XSTYPES_DLL_API void XsVersion_toString(const XsVersion *thisPtr, XsString *version)
struct XsString XsString
Definition: xsstring.h:34
int m_build
The build number of the version.
Definition: xsversion.h:103



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020