getCurrentBackend#

Fully qualified name: isaacsim::foundation::utils::getCurrentBackend

std::string isaacsim::foundation::utils::getCurrentBackend(
const std::initializer_list<std::string> &supportedBackends,
std::optional<bool> raiseOnUnsupported = std::nullopt,
)#

Returns the currently active backend name for this thread.

If a BackendGuard is active on this thread, its backend name is returned. Otherwise, the first entry of supportedBackends is used as the default.

If the active backend is not in supportedBackends, the behavior depends on raiseOnUnsupported (and the corresponding flag stored in the context):

  • If either is true, a std::runtime_error is thrown.

  • Otherwise, the first entry of supportedBackends is returned as a fallback.

Parameters:
  • supportedBackends – [in] Ordered list of backend names accepted by the caller. The first entry is used as the default and fallback.

  • raiseOnUnsupported – [in] Override for the raise-on-unsupported flag. When not nullopt, takes precedence over the value stored in the context.

Throws:
  • std::invalid_argument – If supportedBackends is empty.

  • std::runtime_error – If the active backend is unsupported and raising is enabled.

Returns:

The active backend name, or the first entry of supportedBackends as fallback.

Pre:

supportedBackends must not be empty.