IDS peak genericC++ v1.11.1
Loading...
Searching...
No Matches
peak::Library Class Referencefinal

A collection of global library functions. More...

#include <peak/library/peak_library.hpp>

Static Public Member Functions

static core::Version Version ()
 Returns the library version.
 
Initialize / Close Library

static void Initialize ()
 Initializes the IDS peak genericAPI library.
 
static void Close ()
 Closes the IDS peak genericAPI library and cleans up any resources that are still in use.
 

Detailed Description

A collection of global library functions.

Currently, this includes Library::Initialize() / Library::Close(), which must be called before/after usage of the library, and Library::Version(), to retrieve version information about the the library.

Member Function Documentation

◆ Close()

void peak::Library::Close ( )
inlinestatic

Closes the IDS peak genericAPI library and cleans up any resources that are still in use.

This function should be called after no function of the library is needed anymore, before unloading the library. It cleans up any resources still in use. If an DeviceManager::Update is in progress, the update will finish before the library is closed.

Note
Calling any other function (except Initialize()) after this will result in a core::NotInitializedException.
Calls to Initialize() and Close() are reference counted, so you have to call Close() as many times as you called Initialize().
Warning
It is of particular importance on MS Windows platforms, when using "Run-Time Dynamic Linking", especially when unloading the DLL with FreeLibrary(). Otherwise it is very likely to run into the "Loader-Lock Deadlock Problem" during DLL unloading.
Since
1.0
2.0 Added reference counting
Exceptions
std::runtime_errorwhen dynamic loading is active and and error occured during loading the dynamic library.

◆ Initialize()

void peak::Library::Initialize ( )
inlinestatic

Initializes the IDS peak genericAPI library.

This function must be called prior to any other function call to allow global initialization of library internals. This function is necessary since automated initialization functionality like within DllMain on MS Windows platforms is very limited.

Calling this function multiple times is ok, but note that these calls are reference counted, so you have to call Close() as many times as Initialize().

Since
1.0
2.0 Added reference counting
Note
Calling any other function before this will result in a core::NotInitializedException.
Exceptions
std::runtime_errorwhen dynamic loading is active and and error occured during loading the dynamic library.

◆ Version()

core::Version peak::Library::Version ( )
inlinestatic

Returns the library version.

Returns
Library version
Since
1.0
Exceptions
std::runtime_errorwhen dynamic loading is active and and error occured during loading the dynamic library.

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