h5cpp  0.3.3
A modern C++ wrapper for the HDF5 C library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Member Functions | Related Functions | List of all members
hdf5::Version Class Reference

a 3 number version class More...

#include <version.hpp>

Public Types

using NumberType = unsigned long
 the number type used to represent version numbers More...
 

Public Member Functions

 Version () noexcept
 default constructor More...
 
 Version (NumberType major_number, NumberType minor_number, NumberType patch) noexcept
 constructor More...
 
 Version (const Version &)=default
 copy constructor More...
 
NumberType major_number () const noexcept
 return the major version number More...
 
NumberType minor_number () const noexcept
 return the minor version number More...
 
NumberType patch_number () const noexcept
 return the patch version number More...
 

Static Public Member Functions

static std::string to_string (const Version &version)
 convert a Version to a string More...
 

Related Functions

(Note that these are not member functions.)

DLL_EXPORT std::ostream & operator<< (std::ostream &stream, const Version &version)
 output stream operator More...
 
DLL_EXPORT bool operator== (const Version &lhs, const Version &rhs)
 checks two version for equality More...
 
DLL_EXPORT bool operator!= (const Version &lhs, const Version &rhs)
 checks if two versions are not equal More...
 
DLL_EXPORT bool operator< (const Version &lhs, const Version &rhs)
 checks if the left version is strictly small than the right More...
 
DLL_EXPORT bool operator>= (const Version &lhs, const Version &rhs)
 checks if the left version is bigger or equal than the right More...
 
DLL_EXPORT bool operator> (const Version &lhs, const Version &rhs)
 checks if the left version is strictly bigger than the right More...
 
DLL_EXPORT Version current_library_version ()
 returns the current version of the HDF5 library More...
 

Detailed Description

Describes a version number.

Member Typedef Documentation

◆ NumberType

using hdf5::Version::NumberType = unsigned long

Constructor & Destructor Documentation

◆ Version() [1/3]

hdf5::Version::Version ( )
noexcept

Set all three version numbers to 0

◆ Version() [2/3]

hdf5::Version::Version ( NumberType  major_number,
NumberType  minor_number,
NumberType  patch 
)
noexcept
Parameters
majorthe major version number
minorthe minor version number
patchthe patch version number

◆ Version() [3/3]

hdf5::Version::Version ( const Version )
default

We can use the compiler provided default implementation here as all members are trivially copyable.

Member Function Documentation

◆ major_number()

NumberType hdf5::Version::major_number ( ) const
noexcept

◆ minor_number()

NumberType hdf5::Version::minor_number ( ) const
noexcept

◆ patch_number()

NumberType hdf5::Version::patch_number ( ) const
noexcept

◆ to_string()

static std::string hdf5::Version::to_string ( const Version version)
static

The result is a string with the format MAJOR.MINOR.PATCH.

Parameters
versionreference to a instance of Version
Returns
a new instance of std::string

Friends And Related Function Documentation

◆ current_library_version()

DLL_EXPORT Version current_library_version ( )
related
Exceptions
std::runtime_errorin case of a failure
Returns
instance of Version with the current HDF5 version

◆ operator!=()

DLL_EXPORT bool operator!= ( const Version lhs,
const Version rhs 
)
related
Parameters
lhsreference to the left hand side version
rhsreference to the right hand side version
Returns
true if versions are not equal, false otherwise

◆ operator<()

DLL_EXPORT bool operator< ( const Version lhs,
const Version rhs 
)
related
Parameters
lhsreference to the left hand side version
rhsreference to the right hand side version

◆ operator<<()

DLL_EXPORT std::ostream & operator<< ( std::ostream &  stream,
const Version version 
)
related

Writes an instance of Version to a std::ostream. The output format is the same as for Version::to_string.

Parameters
streamthe stream where to write the version
versionreference to the Version to write
Returns
modified version of std::ostream
See also
Version::to_string

◆ operator==()

DLL_EXPORT bool operator== ( const Version lhs,
const Version rhs 
)
related

Two version are considered equal if all of their parts are equal.

Parameters
lhsreference to the left hand side version
rhsreference to the right hand side version
Returns
true if versions are equal, false otherwise

◆ operator>()

DLL_EXPORT bool operator> ( const Version lhs,
const Version rhs 
)
related
Parameters
lhsreference to the left hand side version
rhsreference to the right hand side version

◆ operator>=()

DLL_EXPORT bool operator>= ( const Version lhs,
const Version rhs 
)
related
Parameters
lhsreference to the left hand side version
rhsreference to the right hand side version

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