CVB++ 14.0
Cvb::Utilities::SystemInfo Namespace Reference

Namespace for helper functions related to system or CVB installation information. More...

Classes

class  LicenseInfo
 Information about CVB licenses. More...
 
class  MagicNumberEntry
 A single Magic Number entry. More...
 

Functions

String HeaderVersion () noexcept
 Returns the version of these headers. More...
 
String VersionMin () noexcept
 Gets the minimum CVB required for these headers. More...
 
String VersionBuild () noexcept
 Gets the CVB version this header set was build/validated with. More...
 
String Version ()
 Full version of the currently installed CVB. More...
 
std::string GetLastErrorMessage (int &errorCode)
 Returns the last error message and its code. More...
 
std::string GetLastErrorMessage ()
 Returns the last error message. More...
 
std::exception_ptr GetLastError () noexcept
 Returns a pointer that points at the exception. More...
 
String ExpandPath (const String &path)
 Expands a path containing an environment variable. More...
 
String InstallPath ()
 Directory Common Vision Blox has been installed to. More...
 
String DataPath ()
 Directory where Common Vision Blox stores its settings. More...
 
std::vector< LicenseInfoGetLicenseInfo ()
 Get information about available licenses. More...
 
template<class Rep , class Period >
WaitStatus WaitForLicense (const std::chrono::duration< Rep, Period > &timeSpan) noexcept
 Wait for a given time for the license to become available. More...
 
std::vector< MagicNumberEntryGetMagicNumberEntries ()
 Query the set of currently available Magic Numbers. More...
 

Detailed Description

Namespace for helper functions related to system or CVB installation information.

Function Documentation

◆ DataPath()

String DataPath ( )
inline

Directory where Common Vision Blox stores its settings.

Returns
A path as string.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ExpandPath()

String ExpandPath ( const String path)
inline

Expands a path containing an environment variable.

Parameters
[in]pathPath with environment variable in windows notation.
Returns
Absolute path without environment variable.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ GetLastError()

std::exception_ptr GetLastError ( )
inlinenoexcept

Returns a pointer that points at the exception.

Returns
A pointer that points at the exception corresponds to the last error.

This function assumes it is called because an error has happened.

◆ GetLastErrorMessage() [1/2]

std::string GetLastErrorMessage ( )
inline

Returns the last error message.

Returns
The last error message encoded in UTF-8.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ GetLastErrorMessage() [2/2]

std::string GetLastErrorMessage ( int &  errorCode)
inline

Returns the last error message and its code.

Parameters
[out]errorCodeThe error code of the last execution.
Returns
The last error message encoded in UTF-8.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ GetLicenseInfo()

std::vector< LicenseInfo > GetLicenseInfo ( )
inline

Get information about available licenses.

Returns
A vector containing the currently available licenses.
Exceptions
Anyexception derived from std::exception including CvbException.

In theory, the collection of available licenses can change any time. However, it is fairly unlikely that during runtime someone unplugs a dongle or removes a Node Locked license, so Common Vision Blox does not implement a costly push/event model for notifying clients during runtime about the presence of new licenses or the loss of a license. Instead, the license information can and needs to be queried using this method.

◆ GetMagicNumberEntries()

std::vector< MagicNumberEntry > GetMagicNumberEntries ( )
inline

Query the set of currently available Magic Numbers.

Returns
A vector containing the currently available magic number entries.
Exceptions
Anyexception derived from std::exception including CvbException.

In theory, the collection of available Magic Numbers can change any time. However, it is fairly unlikely that during runtime someone unplugs a dongle or removes a Node Locked license, so Common Vision Blox does not implement a costly push/event model for notifying clients during runtime about the presence of new Magic Numbers or the loss of a Magic Number. Instead, the Magic Number information can and needs to be queried using this method.

◆ HeaderVersion()

String HeaderVersion ( )
inlinenoexcept

Returns the version of these headers.

Returns
Version string
Exceptions
Doesnot throw any exception.

◆ InstallPath()

String InstallPath ( )
inline

Directory Common Vision Blox has been installed to.

Returns
A path as string.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Version()

String Version ( )
inline

Full version of the currently installed CVB.

Returns
Version string
Exceptions
Anyexception derived from std::exception including CvbException.

◆ VersionBuild()

String VersionBuild ( )
inlinenoexcept

Gets the CVB version this header set was build/validated with.

Returns
Version string
Exceptions
Doesnot throw any exception.

Usually this is the same as VersionMin(), except for nightlys that are build against the next upcomming CVB version.

◆ VersionMin()

String VersionMin ( )
inlinenoexcept

Gets the minimum CVB required for these headers.

Returns
Version string
Exceptions
Doesnot throw any exception.

Even older versions might work in for a subset.

◆ WaitForLicense()

WaitStatus WaitForLicense ( const std::chrono::duration< Rep, Period > &  timeSpan)
inlinenoexcept

Wait for a given time for the license to become available.

Parameters
[in]timeSpanTime to wait for license.
Returns
The status of the wait operation.
Exceptions
Doesnot throw any exception.

This is useful if your application is automatically started after the operating system. E.g. the license service might not be up and running yet. So your application will start without a license. By calling this function you can make sure your application sees a valid license before actually requiring it.