Gamedev Framework (gf)  0.3.0
A C++11 framework for 2D games
Library.h
1 /*
2  * Gamedev Framework (gf)
3  * Copyright (C) 2016 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 namespace gf {
27 #ifndef DOXYGEN_SHOULD_SKIP_THIS
28 inline namespace v1 {
29 #endif
30 
31  /**
32  * @ingroup core
33  * @brief A class to represent the library
34  *
35  * This class is used to initialize the library (especially SDL). Normally,
36  * you do not have to care about it if you use a gf::Window or a
37  * gf::Monitor as the library is automatically initialized with these classes.
38  *
39  * Internally, the class uses reference couting to avoid multiple
40  * initializations.
41  */
42  class GF_API Library {
43  public:
44  /**
45  * @brief Default constructor
46  *
47  * This function initialize the library
48  */
49  Library();
50 
51  /**
52  * @brief Deleted copy constructor
53  */
54  Library(const Library&) = delete;
55 
56  /**
57  * @brief Deleted copy assignment
58  */
59  Library& operator=(const Library&) = delete;
60 
61  /**
62  * @brief Move constructor
63  */
64  Library(Library&&);
65 
66  /**
67  * @brief Move assignment
68  */
70 
71  /**
72  * @brief Destructor
73  *
74  * This function quits the library
75  */
76  ~Library();
77 
78  /**
79  * @brief Information about version
80  */
81  struct Version {
82  int major; ///< Major version number
83  int minor; ///< Minor version number
84  int patch; ///< Patch version number
85  };
86 
87  /**
88  * @brief Get the version of the gf library
89  *
90  * @return The version of the gf library
91  */
92  static Version getVersion();
93 
94  /**
95  * @brief Print the version information about the library and its dependencies
96  */
97  static void printVersionInfo();
98  };
99 
100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
101 }
102 #endif
103 }
104 
105 #endif // GF_LIBRARY_H
Library & operator=(const Library &)=delete
Deleted copy assignment.
Library(const Library &)=delete
Deleted copy constructor.
~Library()
Destructor.
int major
Major version number.
Definition: Library.h:82
Library()
Default constructor.
Library & operator=(Library &&)
Move assignment.
Definition: Action.h:34
A class to represent the library.
Definition: Library.h:42
int minor
Minor version number.
Definition: Library.h:83
static void printVersionInfo()
Print the version information about the library and its dependencies.
static Version getVersion()
Get the version of the gf library.
#define GF_API
Definition: Portability.h:35
int patch
Patch version number.
Definition: Library.h:84
Library(Library &&)
Move constructor.
Information about version.
Definition: Library.h:81