OpenAssetIO
An abstract API for generalising interactions between a host application and an asset management system
openassetio::v1::pluginSystem Namespace Reference

Classes

class  CppPluginSystem
 Generic plugin system for C++ plugins. More...
 
class  CppPluginSystemManagerImplementationFactory
 A factory to manage CppPluginSystemManagerPlugin derived plugins. More...
 
class  CppPluginSystemManagerPlugin
 Base class to be subclassed by plugins binding a host to an Asset Management System. More...
 
class  CppPluginSystemPlugin
 The base class that defines a plugin of the C++ plugin system. More...
 
class  HybridPluginSystemManagerImplementationFactory
 The hybrid plugin system composes one or more child plugin systems, and abstracts away routing API calls based on priority and capability. More...
 

Typedefs

using CppPluginSystemPluginPtr = std::shared_ptr< CppPluginSystemPlugin >
 
using CppPluginSystemPluginConstPtr = std::shared_ptr< const CppPluginSystemPlugin >
 
using CppPluginSystemPtr = std::shared_ptr< CppPluginSystem >
 
using CppPluginSystemConstPtr = std::shared_ptr< const CppPluginSystem >
 
using CppPluginSystemManagerPluginPtr = std::shared_ptr< CppPluginSystemManagerPlugin >
 
using CppPluginSystemManagerPluginConstPtr = std::shared_ptr< const CppPluginSystemManagerPlugin >
 
using CppPluginSystemManagerImplementationFactoryPtr = std::shared_ptr< CppPluginSystemManagerImplementationFactory >
 
using CppPluginSystemManagerImplementationFactoryConstPtr = std::shared_ptr< const CppPluginSystemManagerImplementationFactory >
 
using PluginFactory = openassetio::pluginSystem::CppPluginSystemPluginPtr(*)() noexcept
 Function pointer to a factory that produces instances of CppPluginSystemPlugin wrapped in a shared_ptr. More...
 
using HybridPluginSystemManagerImplementationFactoryPtr = std::shared_ptr< HybridPluginSystemManagerImplementationFactory >
 
using HybridPluginSystemManagerImplementationFactoryConstPtr = std::shared_ptr< const HybridPluginSystemManagerImplementationFactory >
 

Typedef Documentation

typedef std::shared_ptr< const CppPluginSystem > CppPluginSystemConstPtr
typedef std::shared_ptr< const CppPluginSystemPlugin > CppPluginSystemPluginConstPtr
typedef std::shared_ptr< CppPluginSystemPlugin > CppPluginSystemPluginPtr
typedef std::shared_ptr< CppPluginSystem > CppPluginSystemPtr
using PluginFactory = openassetio::pluginSystem::CppPluginSystemPluginPtr (*)() noexcept

Function pointer to a factory that produces instances of CppPluginSystemPlugin wrapped in a shared_ptr.

A pointer to such a function must be returned from an exposed openassetioPlugin entry point function (with C linkage) from a plugin shared library binary. This function pointer is then called to get the CppPluginSystemPlugin instance.

This two-step process is required to work around Windows disallowing C linkage functions from returning C++ types. That is, the openassetioPlugin entry point with C linkage returns a raw pointer (to a function). The returned PluginFactory function pointer can then point to a C++ linkage function, which is allowed to return a CppPluginSystemPluginPtr on Windows.

Exception behaviour varies by platform for functions called via pointers retrieved in this way. In particular, the process is terminated with an "access violation" error on Windows. So for cross-platform consistency, the function is marked noexcept - it is not valid to throw an exception within a PluginFactory.