The ManagerFactory is the primary mechanism for querying for available managers and constructing a Manager.
More...
#include <ManagerFactory.hpp>
|
static ManagerFactoryPtr | make (HostInterfacePtr hostInterface, ManagerImplementationFactoryInterfacePtr managerImplementationFactory, log::LoggerInterfacePtr logger) |
| Construct an instance of this class. More...
|
|
static ManagerPtr | createManagerForInterface (const Identifier &identifier, const HostInterfacePtr &hostInterface, const ManagerImplementationFactoryInterfacePtr &managerImplementationFactory, const log::LoggerInterfacePtr &logger) |
| Create a Manager instance for the manager associated with the given identifier. More...
|
|
static ManagerPtr | defaultManagerForInterface (const HostInterfacePtr &hostInterface, const ManagerImplementationFactoryInterfacePtr &managerImplementationFactory, const log::LoggerInterfacePtr &logger) |
| Creates the default Manager as defined by the TOML configuration file referenced by the $OPENASSETIO_DEFAULT_CONFIG. More...
|
|
static ManagerPtr | defaultManagerForInterface (std::string_view configPath, const HostInterfacePtr &hostInterface, const ManagerImplementationFactoryInterfacePtr &managerImplementationFactory, const log::LoggerInterfacePtr &logger) |
| Creates the default Manager as defined by the given TOML configuration file. More...
|
|
The ManagerFactory is the primary mechanism for querying for available managers and constructing a Manager.
The underlying manager implementation is constructed using the supplied ManagerImplementationFactoryInterface factory implementation.
Hosts should never attempt to directly construct a Manager
class or interact with the implementation factory directly.
Mapping of manager identifier to its configuration details.
Get the details for each available manager as a map of manager identifier to manager details.
This provides the default settings that can be taken and mutated before being used in the initialization of a Manager.
Additional manager metadata is also included that may be useful. For example, this may be presented as part of a manager picker UI widget.
- See also
- ManagerDetail
- Returns
- A ManagerDetail instance for each available manager.
Create a Manager instance for the manager associated with the given identifier.
The instance returned should then be used for all interaction with the manager.
- Parameters
-
identifier | Unique manager identifier. |
- Returns
- Newly instantiated manager.
Create a Manager instance for the manager associated with the given identifier.
The instance returned should then be used for all interaction with the manager.
- Parameters
-
identifier | Unique manager identifier. |
hostInterface | The host's implementation of the HostInterface that uniquely identifies the host and provides common hooks for the manager to query asset-related properties from the host. |
managerImplementationFactory | The factory that will be used to instantiate the manager. See, for example, PythonPluginSystemManagerImplementationFactory. |
logger | The logger instance that will be used for all messaging from the factory and instantiated Manager instances. |
- Returns
- Newly instantiated manager.
Creates the default Manager as defined by the TOML configuration file referenced by the $OPENASSETIO_DEFAULT_CONFIG.
- Note
- This mechanism should be the default approach for a host to initialize the API. Extended functionality to override this configuration can optionally be provided, but the ability to use the shared, default configuration is always required.
- See also
- Alternative direct signature for more details.
- Environment Variables:
- OPENASSETIO_DEFAULT_CONFIG str The path to a TOML file containing configuration information for the default manager.
- Returns
- A default-configured manager if $OPENASSETIO_DEFAULT_CONFIG is set, otherwise a nullptr if the var was not set.
- Exceptions
-
Creates the default Manager as defined by the given TOML configuration file.
This allows deployments to centralize OpenAssetIO manager settings, and for hosts to instantiate this manager without the need for their own settings and persistence mechanism.
The referenced TOML file should have the following structure.
2 identifier = "some.identifier"
4 [manager.settings] # Optional
Any occurrences of ${config_dir}
within TOML string values will be substituted with the absolute path to the directory containing the TOML file, before being passed on to the manager settings.
- Parameters
-
configPath | Path to the TOML config file, compatible with std::ifstream::open . Relative paths resolve to a platform/environment-dependent location. |
hostInterface | The host's implementation of the HostInterface that uniquely identifies the host and provides common hooks for the manager to query asset-related properties from the host. |
managerImplementationFactory | The factory that will be used to instantiate managers. |
logger | The logger instance that will be used for all messaging from the instantiated Manager instances. |
- Returns
- A default-configured manager.
- Exceptions
-
All identifiers known to the factory.
- Note
- This may result in a significant amount of work being performed by the supplied manager interface factory.
- See also
- Manager.identifier.
Construct an instance of this class.
- Parameters
-
hostInterface | The host's implementation of the HostInterface that uniquely identifies the host and provides common hooks for the manager to query asset-related properties from the host. |
managerImplementationFactory | The factory that will be used to instantiate managers. See, for example, PythonPluginSystemManagerImplementationFactory. |
logger | The logger instance that will be used for all messaging from the factory and instantiated Manager instances. |
const Str kDefaultManagerConfigEnvVarName |
|
static |
The documentation for this class was generated from the following file:
- /src/src/openassetio-core/include/openassetio/hostApi/ManagerFactory.hpp