glbinding  2.1.1.000000000000
A C++ binding for the OpenGL API, generated using the gl.xml specification.
Version.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <iosfwd>
5#include <string>
6#include <set>
7#include <utility>
8
9#include <glbinding/glbinding_api.h>
10
11
12namespace glbinding
13{
14
30class GLBINDING_API Version
31{
32public:
38
48 Version(unsigned char majorVersion, unsigned char minorVersion);
49
57 Version(const Version & version);
58
66 Version(Version && version);
67
78 Version & operator=(const Version & version);
79
90 Version & operator=(Version && version);
91
102 bool operator< (const Version & version) const;
103
114 bool operator> (const Version & version) const;
115
126 bool operator==(const Version & version) const;
127
138 bool operator!=(const Version & version) const;
139
150 bool operator>=(const Version & version) const;
151
162 bool operator<=(const Version & version) const;
163
171 unsigned char majorVersion() const;
172
180 unsigned char minorVersion() const;
181
186 operator std::pair<unsigned char, unsigned char>() const;
187
192 operator std::pair<unsigned short, unsigned short>() const;
193
198 operator std::pair<unsigned int, unsigned int>() const;
199
207 std::string toString() const;
208
216 bool isValid() const;
217
227 bool isNull() const;
228
236 const Version & nearest() const;
237
245 static const std::set<Version> & versions();
246
254 static const std::set<Version> preceeding(const Version & version);
255
263 static const std::set<Version> succeeding(const Version & version);
264
272 static const Version & latest();
273
274protected:
275 unsigned char m_major;
276 unsigned char m_minor;
277
278protected:
279 static const std::set<Version> s_validVersions;
280 static const Version s_latest;
281};
282
283
284} // namespace glbinding
285
286
291GLBINDING_API std::ostream & operator<<(std::ostream & stream, const glbinding::Version & version);
GLBINDING_API std::ostream & operator<<(std::ostream &stream, const glbinding::Version &version)
The operator to allow Versions to be printed onto a std::ostream.
The Version class represents an OpenGL feature, consisting of majow version and minor version,...
Definition: Version.h:31
bool operator!=(const Version &version) const
Operator for unequal comparison to another Version.
static const std::set< Version > preceeding(const Version &version)
Returns the list of all valid, previous Versions (Features) known by the gl.xml.
Version(unsigned char majorVersion, unsigned char minorVersion)
Constructor for a Version object with the given major and minor version.
Version & operator=(const Version &version)
The assignment operator of another Version.
unsigned char m_minor
The minor version.
Definition: Version.h:276
Version & operator=(Version &&version)
The assignment operator of another Version that is moved from.
unsigned char minorVersion() const
Accessor for the minor version.
static const std::set< Version > s_validVersions
The set of all valid versions.
Definition: Version.h:279
unsigned char m_major
The major version.
Definition: Version.h:275
Version(const Version &version)
Copy constructor.
static const Version s_latest
The most current version.
Definition: Version.h:280
bool isNull() const
Check if the Version was constructed using the default constructor.
std::string toString() const
Create a string representing the Version using the scheme "<majorVersion>.<minorVersion>".
bool operator>=(const Version &version) const
Operator for greater equal comparison to another Version.
bool operator==(const Version &version) const
Operator for equal comparison to another Version.
static const std::set< Version > succeeding(const Version &version)
Returns the list of all valid, subsequent Versions (Features) known by the gl.xml.
const Version & nearest() const
Returns the nearest valid Version to this Version.
Version()
Default constructor, resulting in an invalid Version object.
unsigned char majorVersion() const
Accessor for the major version.
static const Version & latest()
Return the most current valid Version.
Version(Version &&version)
Move constructor.
bool operator<=(const Version &version) const
Operator for lesser equal comparison to another Version.
bool isValid() const
Check for validity of this Version, based on the list of all valid OpenGL feautures.
static const std::set< Version > & versions()
Accessor for the list of all valid Versions (OpenGL features).
Contains all the classes of glbinding.