OpenLexocad  27.1
Version.h
Go to the documentation of this file.
1 #pragma once
2 #include <memory>
3 
4 
5 namespace Core
6 {
7 class LibraryLoader;
8 class VersionP;
9 
18 class Version
19 {
20 public:
21  using PFN_LexocadVersion = void (*)(int*, int*, int*, int*);
22  using PFN_LexocadVersionPart = int (*)();
23  using PFN_LexocadVersionString = const char* (*)();
24 
25 
26  Version(const Version& other) = delete;
27  Version& operator=(const Version& other) = delete;
28 
29  static Version& instance();
30  /*
31  * NOTE! That the order of declaration of the class members IS very important!
32  * Do not screw with this unless you know how the class initialization goes.
33  * (ISO/IEC 14882:2003(E) section 12.6.2)
34  * On the other hand it will fail in runtime during dll loading... so you will
35  * know :)
36  * - forry
37  */
38 private:
39  Version();
40  std::unique_ptr<LibraryLoader> lxInfoDLL;
41 
42  //PFN_LexocadVersion getLexocadVersion;
43  PFN_LexocadVersionPart getLexocadVersionMajor;
44  PFN_LexocadVersionPart getLexocadVersionMinor;
45  PFN_LexocadVersionPart getLexocadVersionPatch;
46  PFN_LexocadVersionPart getLexocadVersionRevision;
47 
48  PFN_LexocadVersionString getLexocadBuildDateTime;
49  PFN_LexocadVersionString getLexocadDocumentVersion;
50  PFN_LexocadVersionString getLexocadProductVersionStr;
51 
52 public:
53  const unsigned major;
54  const unsigned minor;
55  const unsigned patch;
56  const unsigned revision;
57 
58  const char* buildDateTime;
59  const char* document;
60  const char* product;
61 
62 };
63 
64 extern LX_CORE_EXPORT Version& version; // = Version::instance();
65 }
const char * document
Definition: Version.h:59
const char * buildDateTime
Definition: Version.h:58
int(*)() PFN_LexocadVersionPart
Definition: Version.h:22
const char *(*)() PFN_LexocadVersionString
Definition: Version.h:23
void(*)(int *, int *, int *, int *) PFN_LexocadVersion
Definition: Version.h:21
A proxy class to conveniently get the automatically generated version of lexocad.
Definition: Version.h:18
const unsigned major
Definition: Version.h:53
LX_CORE_EXPORT Version & version
const unsigned revision
Definition: Version.h:56
const char * product
Definition: Version.h:60
Version & operator=(const Version &other)=delete
Definition: Base.h:12
static Version & instance()
const unsigned patch
Definition: Version.h:55
const unsigned minor
Definition: Version.h:54