Gamedev Framework (gf)  0.6.0
A C++11 framework for 2D games
Library.h
1 /*
2  * Gamedev Framework (gf)
3  * Copyright (C) 2016-2017 Julien Bernard
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  * 2. Altered source versions must be plainly marked as such, and must not be
18  * misrepresented as being the original software.
19  * 3. This notice may not be removed or altered from any source distribution.
20  */
21 #ifndef GF_LIBRARY_H
22 #define GF_LIBRARY_H
23 
24 #include "Portability.h"
25 
26 #include <tuple>
27 
28 namespace gf {
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 inline namespace v1 {
31 #endif
32 
33  /**
34  * @ingroup core
35  * @brief A class to represent the library
36  *
37  * This class is used to initialize the library (especially SDL). Normally,
38  * you do not have to care about it if you use a gf::Window or a
39  * gf::Monitor as the library is automatically initialized with these classes.
40  *
41  * Internally, the class uses reference couting to avoid multiple
42  * initializations.
43  */
44  class GF_API Library {
45  public:
46  /**
47  * @brief Default constructor
48  *
49  * This function initialize the library
50  */
51  Library();
52 
53  /**
54  * @brief Deleted copy constructor
55  */
56  Library(const Library&) = delete;
57 
58  /**
59  * @brief Deleted copy assignment
60  */
61  Library& operator=(const Library&) = delete;
62 
63  /**
64  * @brief Move constructor
65  */
66  Library(Library&&);
67 
68  /**
69  * @brief Move assignment
70  */
72 
73  /**
74  * @brief Destructor
75  *
76  * This function quits the library
77  */
78  ~Library();
79 
80  /**
81  * @brief Information about version
82  */
83  struct Version {
84  int major; ///< Major version number
85  int minor; ///< Minor version number
86  int patch; ///< Patch version number
87  };
88 
89  /**
90  * @brief Get the version of the gf library
91  *
92  * @return The version of the gf library
93  */
94  static Version getVersion();
95 
96  /**
97  * @brief Depedencies of gf
98  */
99  enum Dependency {
100  Boost, ///< Boost
102  FreeType, ///< FreeType
103  };
104 
105  /**
106  * @brief Get the version information about the library dependencies
107  *
108  * @return A tuple with the compiled version and the linked version
109  */
110  static std::tuple<Version, Version> getDependencyVersion(Dependency dep);
111 
112  };
113 
114 #ifndef DOXYGEN_SHOULD_SKIP_THIS
115 }
116 #endif
117 }
118 
119 #endif // GF_LIBRARY_H
Library & operator=(const Library &)=delete
Deleted copy assignment.
Library(const Library &)=delete
Deleted copy constructor.
Boost.
Definition: Library.h:100
~Library()
Destructor.
int major
Major version number.
Definition: Library.h:84
Library()
Default constructor.
Library & operator=(Library &&)
Move assignment.
FreeType.
Definition: Library.h:102
The namespace for gf classes.
Definition: Action.h:34
A class to represent the library.
Definition: Library.h:44
int minor
Minor version number.
Definition: Library.h:85
static Version getVersion()
Get the version of the gf library.
SDL.
Definition: Library.h:101
#define GF_API
Definition: Portability.h:35
int patch
Patch version number.
Definition: Library.h:86
Dependency
Depedencies of gf.
Definition: Library.h:99
static std::tuple< Version, Version > getDependencyVersion(Dependency dep)
Get the version information about the library dependencies.
Library(Library &&)
Move constructor.
Information about version.
Definition: Library.h:83