Other

nxLibTranslateReturnCode

static char const *nxLibTranslateReturnCode(int32_t returnCode)

Retrieves a string description for an API return code .

Parameters

returnCode – The return code to convert to a text string

Returns

A pointer to a string description of the return code or nullptr, if an invalid return code was specified.

nxLibGetDebugMessages

const char *nxLibGetDebugMessages(int32_t *result)

Retrieves debug messages. This can also be done remotely from NxLibRemote.

Note

By calling this function the debug buffer will be fully cleared and the debug information can no longer be retrieved with nxLibGetDebugBuffer().

Note

Calling this function will temporarily lock all debug ring buffers and thus block all NxLib threads which are trying to push debug information onto their buffer. The user should therefore choose a point in time when NxLib is not performing time critical computations for his application to retrieve debug information.

Parameters

result – The error code of the operation. If the message buffer could not hold all streamed messages, the error code NxLibDebugMessageOverflow will be returned. In that case, the returned string will contain only the newest debug messages that could fit into the buffer.

Returns

The debug messages from all threads separated by the newline character (\n). Please refer to the string type description for information about usage restrictions applying to the returned pointer.

nxLibGetDebugBuffer

int32_t nxLibGetDebugBuffer(int32_t *result, void *destinationBuffer, int32_t bufferSize, int32_t *bytesRemaining, int32_t clearRead)

Retrieves debug information in a binary format which can be read by NxProfiler. This can also be done remotely from NxLibRemote.

Note

Calling this function will temporarily lock all debug ring buffers and thus block all NxLib threads which are trying to push debug information onto their buffer. The user should therefore choose a point in time when NxLib is not performing time critical computations for his application to retrieve debug information.

Parameters
  • result – The error code of the operation. If the debug buffer could not hold all streamed debug information, the error code NxLibDebugMessageOverflow will be returned.

  • destinationBuffer – Pointer to an allocated memory block.

  • bufferSize – Size of the destination buffer.

  • bytesRemaining – Pointer to an integer. Will be set to the number of remaining bytes in the debug buffer after the read operation.

  • clearRead – When set to true the operation will also remove the retrieved content from the debug buffer.

template<typename T>
static void nxLibGetDebugBuffer(std::vector<T> &data, bool clearRead = true, bool *overflow = 0)

See

nxLibGetDebugBuffer(int32_t*, void*, int32_t, int32_t*, int32_t)

Note

C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.

Template Parameters

T – Element type of the std::vector.

Parameters
  • data – Vector to hold the retrieved debug information. The size of the vector is automatically adjusted to hold all the available debug information.

  • clearRead – If set to true, the operation will also remove the retrieved content from the debug buffer.

  • overflow – Indicates if the buffer has overflowed since the last read operation and older debug information has been lost. This boolean indicates a result equal to NxLibDebugMessageOverflow, in which case no exception is thrown.