Functions

GetDeviceNum

int64_t tcim::GetDeviceNum(const std::string &backend_name = "")

Retrieves the number of Houmo devices with the specified backend name.

Parameters:

backend_name -- [in] The name of the backend. You can get the backend name via GetSupportedBackend or Module::GetBackendName. If set the value to "", the default backend is used for query.

Returns:

Returns the number of Houmo devices with the backend name.

GetSupportedBackend

const std::vector<std::string> &tcim::GetSupportedBackend()

Retrieves the list of backend names supported by the current Houmo device.

Returns:

Returns the supported list of backend names.

GetVersion

const std::string &tcim::GetVersion()

Retrieves the version and release date of the TCIM library.

The version of TCIM library is composed of major, minor and patch. For instance, major = 2, minor = 0, patch = 0, and release date is Nov 11 2024, this API returns 2.0.0 Nov 11 2024.

Returns:

Returns the version and release date of the TCIM library.

operator<<

std::ostream &tcim::operator<<(std::ostream &os, const Status &status)

RegisterLogHandler

Status tcim::RegisterLogHandler(std::unique_ptr<LogHandler> &&handler)

Registers a custom log handler to intercept runtime library logs.

Notes

  • This API supports multiple invocations. The most recent call to this API will replace the previous handler and take effect for subsequent logging events.

  • This API is not thread-safe. You must ensure that no other TCIM APIs are being invoked concurrently during the registration process to avoid race conditions or undefined behavior.

  • This function accepts a std::unique_ptr, meaning ownership is transferred to the library. The caller should not attempt to access the handler object after registration.

Parameters:

handler -- [in] A unique pointer to the user-defined LogHandler instance. Must not be null.

Returns:

Status::OK if registration succeeds, or an error status otherwise.