AliceVision
Photogrammetric Computer Vision Framework
version.hpp
1 // This file is part of the AliceVision project.
2 // Copyright (c) 2016 AliceVision contributors.
3 // This Source Code Form is subject to the terms of the Mozilla Public License,
4 // v. 2.0. If a copy of the MPL was not distributed with this file,
5 // You can obtain one at https://mozilla.org/MPL/2.0/.
6 
7 #pragma once
8 
9 #include <aliceVision/numeric/numeric.hpp>
10 
11 #define ALICEVISION_VERSION_MAJOR 3
12 #define ALICEVISION_VERSION_MINOR 4
13 #define ALICEVISION_VERSION_REVISION 0
14 
15 // Version status could be "release" or "develop".
16 // When moving from release to develop, always increment the minor version.
17 #define ALICEVISION_VERSION_STATUS "develop"
18 
19 // Preprocessor to string conversion
20 #define ALICEVISION_TO_STRING_HELPER(x) #x
21 #define ALICEVISION_TO_STRING(x) ALICEVISION_TO_STRING_HELPER(x)
22 
23 // AliceVision version as a string; for example "0.9.0".
24 #define ALICEVISION_VERSION_STRING \
25  ALICEVISION_TO_STRING(ALICEVISION_VERSION_MAJOR) \
26  "." ALICEVISION_TO_STRING(ALICEVISION_VERSION_MINOR) "." ALICEVISION_TO_STRING(ALICEVISION_VERSION_REVISION)
27 
28 namespace aliceVision {
29 
30 class Version
31 {
32  public:
33  Version()
34  : _v(Vec3i::Zero())
35  {}
36 
37  explicit Version(const Vec3i& v)
38  : _v(v)
39  {}
40 
41  Version(int major, int minor, int micro)
42  : _v(major, minor, micro)
43  {}
44 
45  Version& operator=(const Vec3i& other)
46  {
47  _v = other;
48  return *this;
49  }
50 
51  bool operator<(const Version& other) const
52  {
53  for (Vec3i::Index i = 0; i < 3; i++)
54  {
55  if (_v[i] < other._v[i])
56  {
57  return true;
58  }
59 
60  if (_v[i] > other._v[i])
61  {
62  return false;
63  }
64  }
65 
66  return false;
67  }
68  bool operator>=(const Version& other) const
69  {
70  return !operator<(other);
71  }
72 
73  private:
74  Vec3i _v;
75 };
76 
77 } // namespace aliceVision
aliceVision
Definition: checkerDetector.cpp:32
aliceVision::Version
Definition: version.hpp:30