Motorcortex Core  version: 2.7.6
license.h
1 /*
2  * Developer : Alexey Zakharov (alexey.zakharov@vectioneer.com)
3  * All rights reserved. Copyright (c) 2020 VECTIONEER.
4  */
5 
6 #ifndef MOTORCORTEX_LICENSE_LICENSE_H
7 #define MOTORCORTEX_LICENSE_LICENSE_H
8 
9 #include <memory>
10 #include <string>
11 #include <vector>
12 
13 namespace mcx {
14 
15 namespace license {
16 
17 class Timer;
18 
19 struct Component {
20  std::string name;
21  std::string version;
22 };
23 
24 void addComponent(Component c);
25 
26 std::string listComponents();
27 
28 class License {
29 public:
30  License(const std::string& filename, const std::string& key, bool verbose = false);
31 
32  ~License();
33 
34  bool isValid() const;
35 
36  int64_t status() const;
37 
38  std::string toString() const;
39 
40 private:
41  int64_t status_{};
42  std::shared_ptr<Timer> timer_;
43  std::vector<Component> components_;
44  std::string key_;
45 };
46 
47 } // namespace license
48 
49 } // namespace mcx
50 
51 #endif // MOTORCORTEX_LICENSE_LICENSE_H
mcx::license::License
Definition: license.h:28
mcx::license::Component
Definition: license.h:19