CVB++ 15.0
Cvb::Utilities Namespace Reference

Namespace for helpers and utilities, which are not directly related to image processing. More...

Namespaces

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

Classes

class  LicenseInfo
 Information about CVB licenses. More...
 
class  MagicNumberEntry
 A single Magic Number entry. More...
 
class  RateCounter
 Frame rate measurement counter with selectable averaging window. More...
 
class  StopWatch
 Speed measurement object. More...
 

Typedefs

using StopWatchPtr = std::shared_ptr<StopWatch>
 Convenience shared pointer for StopWatch.
 
using RateCounterPtr = std::shared_ptr<RateCounter>
 Convenience shared pointer for RateCounter.
 

Enumerations

enum class  StopWatchMode { MultiCPU , SingleCPU }
 Mode at which the StopWatch should work. More...
 

Functions

String HeaderVersion () noexcept
 Returns the version of these headers.
 
String Version ()
 Full version of the currently installed CVB.
 
String VersionBuild () noexcept
 Gets the CVB version this header set was build/validated with.
 
String VersionMin () noexcept
 Gets the minimum CVB required for these headers.
 
String DataPath ()
 Directory where Common Vision Blox stores its settings.
 
String ExpandPath (const String &path)
 Expands a path containing an environment variable.
 
std::vector< LicenseInfoGetLicenseInfo ()
 Get information about available licenses.
 
std::vector< MagicNumberEntryGetMagicNumberEntries ()
 Query the set of currently available Magic Numbers.
 
String InstallPath ()
 Directory Common Vision Blox has been installed to.
 
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.
 

Detailed Description

Namespace for helpers and utilities, which are not directly related to image processing.

Remarks
CMake users: Link to imported target CVB::CvbUtilities

Enumeration Type Documentation

◆ StopWatchMode

enum class StopWatchMode
strong

Mode at which the StopWatch should work.

Enumerator
MultiCPU 

The StopWatch works safe in multi-CPU environments. For that, some degree of accuracy is lost, because under Windows the timers, that are safe to use on a multi-CPU system, are limited to 1 ms granularity.

SingleCPU 

The StopWatch works with a granularity of less than 1 ms (basically with what the Windows SDK function QueryPerformanceFrequency returns). However, a time generated with this mode will not be safe to use in a multi-CPU (not multi-core!) environment because, a thread may travel between CPUs and the timers are not synchronized between CPUs.

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.

◆ 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()

template<class Rep, class Period>
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.