omni::ext::IRegistryProvider

Defined in omni/ext/IExtensions.h

class IRegistryProvider : public carb::IObject

Interface to be implemented by registry providers.

Extension manager will use it to pull (when resolving dependencies) and publish extensions.

This is a sub-interface, with version controlled by IExtensions.

See also

ExtensionManager, ExtensionManager::addRegistryProvider(), IExtensions

Public Functions

virtual DownloadState refreshIndex() = 0

Called by ExtensionManager to begin an asynchronous index refresh or check status on an asynchronous refresh.

This function will be called many times and should return immediately. The returned state should be one of DownloadState. The first call to this function should begin a background index refresh and return DownloadState::eDownloading. Further calls to this function may return the same result while the refresh is in process. When the refresh is finished, the next call should return DownloadState::eDownloadSuccess, at which point the ExtensionManager will call syncIndex().

See also

ExtensionManager

Returns

the DownloadState

virtual carb::dictionary::Item *syncIndex() = 0

Called by ExtensionManager to get the index.

Extension manager will call that function from time to time to get remote index. The structure of this dictionary is a map from extension ids to extension configuration (mostly extension.toml files).

See also

ExtensionManager, carb::dictionary::IDictionary

Returns

A carb::dictionary::Item tree representing the remote index.

virtual bool publishExtension(const char *extPath, carb::dictionary::Item *extDict) = 0

Called by ExtensionManager to trigger extension publishing.

See also

ExtensionManager, unpublishExtension(), carb::dictionary::IDictionary

Parameters
  • extPath – The path to the extension to publish

  • extDict – A carb::dictionary::Item containing data about this extension

Returns

true if publishing was successful; false if an error occurs

virtual bool unpublishExtension(const char *extId) = 0

Called by ExtensionManager to remove an extension.

See also

ExtensionManager, publishExtension()

Parameters

extId – the extension ID of the extension to remove

Returns

true if removal was successful; false if an error occurs

virtual bool pullExtension(const char *extId, const char *extFolder) = 0

Called by ExtensionManager to pull an extension, from a remote location to local cache.

See also

ExtensionManager

Parameters
  • extId – The extension ID of the extension to pull

  • extFolder – The folder to store the extension files in

Returns

true if pulling was successful; false if an error occurs

virtual DownloadState pullExtensionAsync(const char *extId, const char *extFolder) = 0

Called by ExtensionManager to asynchronously pull an extension, from a remote location to local cache.

This function will be called several times. The first time it is called for a given extId and extFolder, it should start a background download process and return DownloadState::eDownloading. It will be called periodically to check the download state. Once the extension has been downloaded, this function should return DownloadState::eDownloadSuccess, or DownloadState::eDownloadFailure if an error occurs.

See also

ExtensionManager, DownloadState

Parameters
  • extId – The extension ID of the extension to pull

  • extFolder – The folder to store the extension files in

Returns

the current DownloadState of the given extId

virtual bool setMaxStrippingLevel(int32_t level) = 0

Called by ExtensionManager to set the maximum level of index stripping.

Deprecated since version This: method is deprecated and no longer called.

virtual size_t addRef() = 0

Atomically add one to the reference count.

Returns

The current reference count after one was added, though this value may change before read if other threads are also modifying the reference count. The return value is guaranteed to be non-zero.

virtual size_t release() = 0

Atomically subtracts one from the reference count.

If the result is zero, carb::deleteHandler() is called for this.

Returns

The current reference count after one was subtracted. If zero is returned, carb::deleteHandler() was called for this.

Public Static Functions

static inline constexpr carb::InterfaceDesc getInterfaceDesc() noexcept

Returns information about this interface.

Auto-generated by CARB_PLUGIN_INTERFACE() or CARB_PLUGIN_INTERFACE_EX.

Returns

The carb::InterfaceDesc struct with information about this interface.

static inline constexpr carb::InterfaceDesc getLatestInterfaceDesc() noexcept

Returns information about the latest version of this interface.

Auto-generated by CARB_PLUGIN_INTERFACE() or CARB_PLUGIN_INTERFACE_EX.

Returns

The carb::InterfaceDesc struct with information about the latest version of this interface.