TLibrary

primo::avblocks::modern::TLibrary

class TLibrary

RAII owner of the AVBlocks library and a static facade over primo::avblocks::Library.

Constructing a TLibrary initializes 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 the primo::avblocks::Library namespace.

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.

TLibrary(const TLibrary&) = delete
TLibrary &operator=(const TLibrary&) = delete
TLibrary(TLibrary&&) = delete
TLibrary &operator=(TLibrary&&) = delete

Public Static Functions

static inline bool initialize()

Initializes the library.

Must be called once before the library is used unless a TLibrary instance is created.

Returns:

true if 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 – true to 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 nullptr the library license state is cleared.

Returns:

The license status after the license is set, as a combination of primo::license::LicenseStatusFlags::Enum flags.