TLibrary¶
primo::avblocks::modern::TLibrary
-
class TLibrary¶
RAII owner of the AVBlocks library and a static facade over
primo::avblocks::Library.Constructing a
TLibraryinitializes the library and destroying it shuts the library down. Create one instance before using any other class in this header and keep it alive for as long as AVBlocks is used. The static members mirror the functions of theprimo::avblocks::Librarynamespace.Not copyable and not movable.
TLibrary lib; std::cout << TLibrary::description() << std::endl;
Public Functions
-
inline TLibrary()¶
Initializes the AVBlocks library.
-
inline ~TLibrary()¶
Shuts the AVBlocks library down and frees the resources it uses.
Public Static Functions
-
static inline bool initialize()¶
Initializes the library.
Must be called once before the library is used unless a
TLibraryinstance is created.- Returns:
trueif the library is initialized successfully.
-
static inline void shutdown()¶
Closes the library and frees the resources it uses. Call it when the library is not needed anymore.
-
static inline const char *description()¶
Returns the build description: full version, architecture, configuration (Release/Debug), license (OEM/Demo) and platform.
-
static inline int32_t majorVersion()¶
Returns the library major version.
-
static inline int32_t minorVersion()¶
Returns the library minor version.
-
static inline int32_t patchVersion()¶
Returns the library patch version. It changes for bug fixes and small improvements that do not affect the API.
-
static inline void setLicenseTls(bool useTls)¶
Sets whether TLS (Transport Layer Security) is used to validate the license.
TLS is not used by default. Call it before
setLicense()to have an effect.- Parameters:
useTls –
trueto validate the license over TLS.
-
static inline int32_t setLicense(const char *license)¶
Sets a license string.
The license is appended to the library license state.
- Parameters:
license – The license string. If
nullptrthe library license state is cleared.- Returns:
The license status after the license is set, as a combination of
primo::license::LicenseStatusFlags::Enumflags.
-
inline TLibrary()¶