Main MRPT website > C++ reference for MRPT 1.5.7
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-2017, 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 { 0, 0, 0, 0, XsString_INITIALIZER }
21 #endif
22 
23 XSTYPES_DLL_API int XsVersion_empty(const XsVersion* thisPtr);
25 
26 #ifdef __cplusplus
27 } // extern "C"
28 #endif
29 
30 struct XsVersion {
31 #ifdef __cplusplus
32  //! \brief Constructs a version object using the supplied parameters or an empty version object if no parameters are given.
33  explicit XsVersion(int maj = 0, int min = 0, int rev = 0, int bld = 0, const XsString& extra = XsString())
34  : m_major(maj)
35  , m_minor(min)
36  , m_revision(rev)
37  , m_build(bld)
38  , m_extra(extra)
39  {}
40 
41  //! \brief Constructs a version object based upon the \a other object
42  XsVersion(const XsVersion& other)
43  : m_major(other.m_major)
44  , m_minor(other.m_minor)
45  , m_revision(other.m_revision)
46  , m_build(other.m_build)
47  , m_extra(other.m_extra)
48  {}
49 
50  //! \brief Assign the version from the \a other object
51  XsVersion& operator = (const XsVersion& other)
52  {
53  m_major = other.m_major;
54  m_minor = other.m_minor;
55  m_revision = other.m_revision;
56  m_build = other.m_build;
57  m_extra = other.m_extra;
58  return *this;
59  }
60 
61  //! \brief \copybrief XsVersion_empty
62  inline bool empty() const
63  {
64  return 0 != XsVersion_empty(this);
65  }
66 
67  //! \brief \copybrief XsVersion_toString
68  inline XsString toString() const
69  {
70  XsString tmp;
71  XsVersion_toString(this, &tmp);
72  return tmp;
73  }
74 
75  //! \brief Return the \e major part of the version
76  inline int major() const { return m_major; }
77  //! \brief Return the \e minor part of the version
78  inline int minor() const { return m_minor; }
79  //! \brief Return the \e revision part of the version
80  inline int revision() const { return m_revision; }
81  //! \brief Return the \e build \e number part of the version
82  inline int build() const { return m_build; }
83  //! \brief Return the extra part of the version. This may contain custom version details such as 'beta' or 'Mk4' to indicate the readiness and purpose of this version of the object.
84  inline XsString extra() const { return m_extra; }
85 
86 private:
87 #endif
88 
89  int m_major; //!< The major part of the version number
90  int m_minor; //!< The minor part of the version number
91  int m_revision; //!< The revision number of the version
92  int m_build; //!< The build number of the version
93  XsString m_extra; //!< Storage for some extra information about the version
94 };
95 
96 #endif // file guard
XsString m_extra
Storage for some extra information about the version.
Definition: xsversion.h:93
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:89
XSTYPES_DLL_API int XsVersion_empty(const XsVersion *thisPtr)
int m_minor
The minor part of the version number.
Definition: xsversion.h:90
int version
Definition: mrpt_jpeglib.h:898
int m_revision
The revision number of the version.
Definition: xsversion.h:91
#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:92



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019