CVersion.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //-----------------------------------------------------------------------------
  2. // (c) 2008 by Basler Vision Technologies
  3. // Section: Vision Components
  4. // Project: GenApi
  5. // Author: Fritz Dierks
  6. // $Header$
  7. //
  8. // License: This file is published under the license of the EMVA GenICam Standard Group.
  9. // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
  10. // If for some reason you are missing this file please contact the EMVA or visit the website
  11. // (http://www.genicam.org) for a full copy.
  12. //
  13. // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
  14. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  15. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
  17. // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  22. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  23. // POSSIBILITY OF SUCH DAMAGE.
  24. //-----------------------------------------------------------------------------
  25. /*!
  26. \file
  27. \brief C++ class wrapping CLSerialAll and CLProtocolDriver
  28. */
  29. #ifndef CLPROTOCOL_CVERSION_H
  30. #define CLPROTOCOL_CVERSION_H
  31. #include <Base\GCBase.h>
  32. #include <CLProtocol\CLProtocol.h>
  33. namespace CLProtocol
  34. {
  35. //! Encapsulates a version number
  36. /*! \ingroup PublicInterfaces */
  37. class CLPROTOCOL_DECL CVersion
  38. {
  39. public:
  40. //! Constructor
  41. CVersion();
  42. //! Copy Constructor
  43. CVersion(const CVersion& Version);
  44. //! Copy Assignment
  45. CVersion& operator=(const CVersion& Version);
  46. //! Parse a Version string
  47. /*!
  48. Returns true if the parsing was successful.
  49. The following two forms of strings are allowed
  50. "SchemaVersion.1.2"
  51. "XMLVersion.1.2.3"
  52. */
  53. bool FromString(const GENICAM_NAMESPACE::gcstring strVersion);
  54. GENICAM_NAMESPACE::gcstring ToString();
  55. //! Comparison (for sorting)
  56. bool operator>(const CVersion& Version) const;
  57. bool operator<(const CVersion& Version) const;
  58. bool operator==(const CVersion& Version) const;
  59. protected:
  60. //! Major version number; if changed backward compatiblitity is broken
  61. int32_t m_Major;
  62. //! Minor version number; if changed backward compatiblitity is maintained
  63. int32_t m_Minor;
  64. //! SubMinor version number; bugfixes only - no new features
  65. int32_t m_SubMinor;
  66. };
  67. }
  68. #endif // CLPROTOCOL_CVERSION_H