glbinding  3.0.2.58901078581f
A C++ binding for the OpenGL API, generated using the gl.xml specification.
glbinding::Version Class Reference

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

GLBINDING_CONSTEXPR Version ()
 Default constructor, resulting in an invalid Version object. More...
 
GLBINDING_CONSTEXPR Version (unsigned char majorVersion, unsigned char minorVersion)
 Constructor for a Version object with the given major and minor version. More...
 
GLBINDING_CONSTEXPR Version (const Version &version)
 Copy constructor. More...
 
 Version (Version &&version)
 Move constructor. More...
 
GLBINDING_CONSTEXPR unsigned char majorVersion () const
 Accessor for the major version. More...
 
GLBINDING_CONSTEXPR 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...
 
GLBINDING_CONSTEXPR bool isNull () const
 Check if the Version was constructed using the default 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...
 
GLBINDING_CONSTEXPR bool operator< (const Version &version) const
 Operator for lesser comparison to another Version. More...
 
GLBINDING_CONSTEXPR bool operator> (const Version &version) const
 Operator for greater comparison to another Version. More...
 
GLBINDING_CONSTEXPR bool operator== (const Version &version) const
 Operator for equal comparison to another Version. More...
 
GLBINDING_CONSTEXPR bool operator!= (const Version &version) const
 Operator for unequal comparison to another Version. More...
 
GLBINDING_CONSTEXPR bool operator>= (const Version &version) const
 Operator for greater equal comparison to another Version. More...
 
GLBINDING_CONSTEXPR bool operator<= (const Version &version) const
 Operator for lesser equal comparison to another Version. More...
 

Protected Attributes

unsigned char m_major
 The major version. More...
 
unsigned char m_minor
 The minor 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:

const glbinding::Version currentVersion = glbinding::aux::ContextInfo::version();
if (currentVersion >= glbinding::Version(3, 2))
{
// do something
}

Constructor & Destructor Documentation

GLBINDING_CONSTEXPR glbinding::Version::Version ( )
inline

Default constructor, resulting in an invalid Version object.

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

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

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

Copy constructor.

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

Move constructor.

Parameters
[in]versionThe Version the data is moved from

Member Function Documentation

GLBINDING_CONSTEXPR unsigned char glbinding::Version::majorVersion ( ) const
inline

Accessor for the major version.

Returns
the major version

References m_major.

GLBINDING_CONSTEXPR unsigned char glbinding::Version::minorVersion ( ) const
inline

Accessor for the minor version.

Returns
the minor version

References m_major, and m_minor.

std::string glbinding::Version::toString ( ) const
inline

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

Returns
The version as string, "-.-" iff the string is invalid

References isNull(), m_major, and m_minor.

GLBINDING_CONSTEXPR bool glbinding::Version::isNull ( ) const
inline

Check if the Version was constructed using the default constructor.

Returns
'true' if the major version is 0, else 'false'
Remarks
This method can be used to check if this Version was constructed using the default constructor or is otherwise malformed

References m_major.

Referenced by toString().

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

The assignment operator of another Version.

Parameters
[in]versionThe version the data is used from
Returns
The reference to this Version

References m_major, and m_minor.

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

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

References m_major, and m_minor.

GLBINDING_CONSTEXPR bool glbinding::Version::operator< ( const Version version) const
inline

Operator for lesser comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
'true' if this Version is lesser than the other Version, else 'false'

References m_major, and m_minor.

GLBINDING_CONSTEXPR bool glbinding::Version::operator> ( const Version version) const
inline

Operator for greater comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
'true' if this Version is greater than the other Version, else 'false'

References m_major, and m_minor.

GLBINDING_CONSTEXPR bool glbinding::Version::operator== ( const Version version) const
inline

Operator for equal comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
'true' if this Version is equal to the other Version, else 'false'

References m_major, and m_minor.

GLBINDING_CONSTEXPR bool glbinding::Version::operator!= ( const Version version) const
inline

Operator for unequal comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
'true' if this Version is not equal to the other Version, else 'false'

References m_major, and m_minor.

GLBINDING_CONSTEXPR bool glbinding::Version::operator>= ( const Version version) const
inline

Operator for greater equal comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
'true' if this Version is greater or equal than the other Version, else 'false'
GLBINDING_CONSTEXPR bool glbinding::Version::operator<= ( const Version version) const
inline

Operator for lesser equal comparison to another Version.

Parameters
[in]versionThe Version to compare to
Returns
'true' if this Version is lesser or equal than the other Version, else 'false'

Member Data Documentation

unsigned char glbinding::Version::m_major
protected
unsigned char glbinding::Version::m_minor
protected

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