glbinding  2.1.1.96dbfd46d679
A C++ binding for the OpenGL API, generated using the gl.xml specification.

The Version class represents an OpenGL feature, consisting of majow version and minor version, excluding the profile information. More...

#include <glbinding/include/glbinding/Version.h>

Public Member Functions

 Version ()
 Default constructor, resulting in an invalid Version object. More...
 
 Version (unsigned char majorVersion, unsigned char minorVersion)
 Constructor for a Version object with the given major and minor version. More...
 
 Version (const Version &version)
 Copy constructor. More...
 
 Version (Version &&version)
 Move constructor. More...
 
Versionoperator= (const Version &version)
 The assignment operator of another Version. More...
 
Versionoperator= (Version &&version)
 The assignment operator of another Version that is moved from. More...
 
bool operator< (const Version &version) const
 Operator for lesser comparison to another Version. More...
 
bool operator> (const Version &version) const
 Operator for greater comparison to another Version. More...
 
bool operator== (const Version &version) const
 Operator for equal comparison to another Version. More...
 
bool operator!= (const Version &version) const
 Operator for unequal comparison to another Version. More...
 
bool operator>= (const Version &version) const
 Operator for greater equal comparison to another Version. More...
 
bool operator<= (const Version &version) const
 Operator for lesser equal comparison to another Version. More...
 
unsigned char majorVersion () const
 Accessor for the major version. More...
 
unsigned char minorVersion () const
 Accessor for the minor version. More...
 
std::string toString () const
 Create a string representing the Version using the scheme "<majorVersion>.<minorVersion>". More...
 
bool isValid () const
 Check for validity of this Version, based on the list of all valid OpenGL feautures. More...
 
bool isNull () const
 Check if the Version was constructed using the default constructor. More...
 
const Versionnearest () const
 Returns the nearest valid Version to this Version. More...
 

Static Public Member Functions

static const std::set< Version > & versions ()
 Accessor for the list of all valid Versions (OpenGL features). More...
 
static const std::set< Versionpreceeding (const Version &version)
 Returns the list of all valid, previous Versions (Features) known by the gl.xml. More...
 
static const std::set< Versionsucceeding (const Version &version)
 Returns the list of all valid, subsequent Versions (Features) known by the gl.xml. More...
 
static const Versionlatest ()
 Return the most current valid Version. More...
 

Protected Attributes

unsigned char m_major
 The major version. More...
 
unsigned char m_minor
 The minor version. More...
 

Static Protected Attributes

static const std::set< Versions_validVersions
 The set of all valid versions. More...
 
static const Version s_latest
 The most current version. More...
 

Detailed Description

The Version class represents an OpenGL feature, consisting of majow version and minor version, excluding the profile information.

This instance can represent both any officially released OpenGL feature and other combinations of major and minar version and provides methods for validity checking and comparison.

Example code:

if (currentVersion >= glbinding::Version(3, 2))
{
// do something
}

Constructor & Destructor Documentation

glbinding::Version::Version ( )

Default constructor, resulting in an invalid Version object.

glbinding::Version::Version ( unsigned char  majorVersion,
unsigned char  minorVersion 
)

Constructor for a Version object with the given major and minor version.

Parameters
[in]majorVersionThe major version
[in]minorVersionThe minor version
glbinding::Version::Version ( const Version version)

Copy constructor.

Parameters
[in]versionThe Version the data is used from
glbinding::Version::Version ( Version &&  version)

Move constructor.

Parameters
[in]versionThe Version the data is moved from

Member Function Documentation

Version& glbinding::Version::operator= ( const Version version)

The assignment operator of another Version.

Parameters
[in]versionThe version the data is used from
Returns
The reference to this Version
Version& glbinding::Version::operator= ( Version &&  version)

The assignment operator of another Version that is moved from.

Parameters
[in]versionThe version the data is moved from
Returns
The reference to this Version
bool glbinding::Version::operator< ( const Version version) const

Operator for lesser comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
true iff this Version is lesser than the other Version
bool glbinding::Version::operator> ( const Version version) const

Operator for greater comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
true iff this Version is greater than the other Version
bool glbinding::Version::operator== ( const Version version) const

Operator for equal comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
true iff this Version is equal to the other Version
bool glbinding::Version::operator!= ( const Version version) const

Operator for unequal comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
true iff this Version is not equal to the other Version
bool glbinding::Version::operator>= ( const Version version) const

Operator for greater equal comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
true iff this Version is greater or equal than the other Version
bool glbinding::Version::operator<= ( const Version version) const

Operator for lesser equal comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
true iff this Version is lesser or equal than the other Version
unsigned char glbinding::Version::majorVersion ( ) const

Accessor for the major version.

Returns
the major version
unsigned char glbinding::Version::minorVersion ( ) const

Accessor for the minor version.

Returns
the minor version
std::string glbinding::Version::toString ( ) const

Create a string representing the Version using the scheme "<majorVersion>.<minorVersion>".

Returns
The version as string, "-.-" iff the string is invalid.
bool glbinding::Version::isValid ( ) const

Check for validity of this Version, based on the list of all valid OpenGL feautures.

Returns
true iff the version is valid (i.e., if this version is present in the set of valid versions).
bool glbinding::Version::isNull ( ) const

Check if the Version was constructed using the default constructor.

Returns
true iff the major version is 0.

This method can be used to check if this Version was constructed using the default constructor or is otherwise malformed.

const Version& glbinding::Version::nearest ( ) const

Returns the nearest valid Version to this Version.

Returns
the nearest valid Version that is either equal or lower than this Version.
static const std::set<Version>& glbinding::Version::versions ( )
static

Accessor for the list of all valid Versions (OpenGL features).

Returns
the set of all valid Versions (= released OpenGL Features).
static const std::set<Version> glbinding::Version::preceeding ( const Version version)
static

Returns the list of all valid, previous Versions (Features) known by the gl.xml.

Returns
The list of all valid Versions (Features) with a version number below the provided one.
static const std::set<Version> glbinding::Version::succeeding ( const Version version)
static

Returns the list of all valid, subsequent Versions (Features) known by the gl.xml.

Returns
The list of all valid Versions (Features) with a version number above the provided one.
static const Version& glbinding::Version::latest ( )
static

Return the most current valid Version.

Returns
the most current Version from the set of all valid versions.

Member Data Documentation

unsigned char glbinding::Version::m_major
protected

The major version.

unsigned char glbinding::Version::m_minor
protected

The minor version.

const std::set<Version> glbinding::Version::s_validVersions
staticprotected

The set of all valid versions.

const Version glbinding::Version::s_latest
staticprotected

The most current version.


The documentation for this class was generated from the following file: