documentation

Global functions which can be called without a corresponding object which handles the request. More...

Functions

VL_SDK_API unsigned int VL_CALLINGCONVENTION vlGetVersionMajor ()
 Returns the major version number of the VisionLib plugin. More...
 
VL_SDK_API unsigned int VL_CALLINGCONVENTION vlGetVersionMinor ()
 Returns the minor version number of the VisionLib plugin. More...
 
VL_SDK_API unsigned int VL_CALLINGCONVENTION vlGetVersionRevision ()
 Returns the revision version number of the VisionLib plugin. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlGetVersionString (char version[], unsigned int maxSize)
 Copies the version string of the VisionLib plugin into a buffer. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlGetVersionHashString (char version[], unsigned int maxSize)
 Copies the version hash of the VisionLib plugin into a buffer. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlGetVersionTimestampString (char versionTimeStamp[], unsigned int maxSize)
 Copies the version timestamp of the VisionLib plugin into a buffer. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlAddLogListener (vlCallbackZString fn, void *clientData)
 Registers a log listener. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlRemoveLogListener (vlCallbackZString fn, void *clientData)
 Unregisters a log listener. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlClearLogListeners ()
 Removes all log listeners. More...
 
VL_SDK_API void VL_CALLINGCONVENTION vlEnableLogBuffer ()
 Enables log buffering. More...
 
VL_SDK_API void VL_CALLINGCONVENTION vlDisableLogBuffer ()
 Disables log buffering. More...
 
VL_SDK_API void VL_CALLINGCONVENTION vlSetLogBufferSize (unsigned int maxEntries)
 Sets the maximum number of log messages in the log buffer. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlFlushLogBuffer ()
 Notifies registered log listeners of all buffered log messages. More...
 
VL_SDK_API int VL_CALLINGCONVENTION vlGetLogLevel ()
 Gets the current log level. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlSetLogLevel (int level)
 Sets the log level. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlLog (const char message[], int level)
 Logs the given message as VisionLib log. More...
 

Detailed Description

Global functions which can be called without a corresponding object which handles the request.

Function Documentation

◆ vlAddLogListener()

VL_SDK_API bool VL_CALLINGCONVENTION vlAddLogListener ( vlCallbackZString  fn,
void *  clientData 
)

Registers a log listener.

Parameters
fnListener function which will receive all VisionLib log messages.
clientDataThe listener will be notified with the given pointer value. This can be used to invoke a member function.
Returns
true, on success; false otherwise.

◆ vlClearLogListeners()

VL_SDK_API bool VL_CALLINGCONVENTION vlClearLogListeners ( )

Removes all log listeners.

Returns
true, on success; false otherwise.

◆ vlDisableLogBuffer()

VL_SDK_API void VL_CALLINGCONVENTION vlDisableLogBuffer ( )

Disables log buffering.

If log buffering is disabled, then log messages will get dispatched immediately. This might happen from a different thread. Therefore one must make sure, that registered log listeners are thread-safe.

With disabled log buffering, calling the vlFlushLogBuffer function is not necessary.

By default log buffering is disabled.

◆ vlEnableLogBuffer()

VL_SDK_API void VL_CALLINGCONVENTION vlEnableLogBuffer ( )

Enables log buffering.

If log buffering is enabled, then log messages will not get dispatched immediately. Instead they will get buffered and one must continuously call the vlFlushLogBuffer function in order to dispatch the buffered log messages to the registered listeners.

This has the advantage, that registered listeners will not get notified from some arbitrary thread, which would require proper thread synchronization.

By default log buffering is disabled.

◆ vlFlushLogBuffer()

VL_SDK_API bool VL_CALLINGCONVENTION vlFlushLogBuffer ( )

Notifies registered log listeners of all buffered log messages.

If log buffering is enabled, then log messages will not get dispatched immediately. Instead they will get buffered and one must continuously call the vlFlushLogBuffer function in order to dispatch the buffered log messages to the registered listeners.

Failing to call vlFlushLogBuffer with enabled log buffering will have the effect, that registered log listeners will not get notified of any log messages and old log messages will be lost forever.

Returns
true, on success; false otherwise.

◆ vlGetLogLevel()

VL_SDK_API int VL_CALLINGCONVENTION vlGetLogLevel ( )

Gets the current log level.

Returns
The log level (0: log, 1: fatal, 2: warning, 3: notice, 4: info, 5: debug).

◆ vlGetVersionHashString()

VL_SDK_API bool VL_CALLINGCONVENTION vlGetVersionHashString ( char  version[],
unsigned int  maxSize 
)

Copies the version hash of the VisionLib plugin into a buffer.

Parameters
versionBuffer for storing the version hash.
maxSizeThe size of the buffer.
Returns
true, on success; false otherwise.

◆ vlGetVersionMajor()

VL_SDK_API unsigned int VL_CALLINGCONVENTION vlGetVersionMajor ( )

Returns the major version number of the VisionLib plugin.

◆ vlGetVersionMinor()

VL_SDK_API unsigned int VL_CALLINGCONVENTION vlGetVersionMinor ( )

Returns the minor version number of the VisionLib plugin.

◆ vlGetVersionRevision()

VL_SDK_API unsigned int VL_CALLINGCONVENTION vlGetVersionRevision ( )

Returns the revision version number of the VisionLib plugin.

◆ vlGetVersionString()

VL_SDK_API bool VL_CALLINGCONVENTION vlGetVersionString ( char  version[],
unsigned int  maxSize 
)

Copies the version string of the VisionLib plugin into a buffer.

Parameters
versionBuffer for storing the version string.
maxSizeThe size of the buffer.
Returns
true, on success; false otherwise.

◆ vlGetVersionTimestampString()

VL_SDK_API bool VL_CALLINGCONVENTION vlGetVersionTimestampString ( char  versionTimeStamp[],
unsigned int  maxSize 
)

Copies the version timestamp of the VisionLib plugin into a buffer.

Parameters
versionBuffer for storing the version timestamp.
maxSizeThe size of the buffer.
Returns
true, on success; false otherwise.

◆ vlLog()

VL_SDK_API bool VL_CALLINGCONVENTION vlLog ( const char  message[],
int  level 
)

Logs the given message as VisionLib log.

Parameters
messageZero terminated string with the message.
levelLog level (0: log, 1: fatal, 2: warning, 3: notice, 4: info, 5: debug).
Returns
true, on success; false otherwise.

◆ vlRemoveLogListener()

VL_SDK_API bool VL_CALLINGCONVENTION vlRemoveLogListener ( vlCallbackZString  fn,
void *  clientData 
)

Unregisters a log listener.

Parameters
fnListener, which should be removed.
clientDataPointer value which was used during the registration.
Returns
true, on success; false otherwise.

◆ vlSetLogBufferSize()

VL_SDK_API void VL_CALLINGCONVENTION vlSetLogBufferSize ( unsigned int  maxEntries)

Sets the maximum number of log messages in the log buffer.

If log buffering is enabled, then log messages will get buffered. In order to not allocate too much memory, the size of the log buffer is limited to a certain number of entries. If there are too many log messages in the buffer, then the oldest message will get removed.

By default the maximum number of buffer entries is 32.

◆ vlSetLogLevel()

VL_SDK_API bool VL_CALLINGCONVENTION vlSetLogLevel ( int  level)

Sets the log level.

It is recommended to set the log level to 2 (warning) during development, otherwise there will be too many messages. Only for debugging purposes it might be useful to increase the log level. Before deploying your application you should set the log level to 0 (log) or 1 (fatal).

Parameters
levelNew log level. (0: log, 1: fatal, 2: warning, 3: notice, 4: info, 5: debug).
Returns
true, on success; false otherwise.