score::InterfaceBase Class Referenceabstract
Base class for plug-in interfaces. More...
Inheritance diagram for score::InterfaceBase:
Detailed Description
Base class for plug-in interfaces.
The plug-in interfaces in score are organized as follows :
- Each base interface should inherit from Interface<MyInterface>
- There is a key type to identify each interface type : score::InterfaceKey
- Then, each implementation of each interface should itself provide a key to identify itself with regards to the other implementations.
This then allows to :
- Fetch a specific interface from an score::ApplicationContext :
// First get the interface list we are looking for, for instance
// the list of all process factories interface :
score::ApplicationContext& context = ...;
auto& iface_list = context.interfaces<MyInterfaceList>();
Used to access all the application-wide state and structures.
Definition: ApplicationContext.hpp:24
const T & interfaces() const
Access to a specific interface list.
Definition: ApplicationContext.hpp:67
- Then look for the actual factory we want, obtained from user input for instance :
auto iface = iface_list.get(actual_factory_key);
// If iface is != nullptr, it means that we have a concrete factory to build
// a specific kind of process.
The actual hierarchy looks like :
InterfaceBase <- MyInterface <- MyImplementation
<- OtherInterface <- OtherImplementation1
<- OtherImplementation2
Public Member Functions | |
virtual InterfaceKey | interfaceKey () const noexcept=0 |
Identifies an interface uniquely. | |
The documentation for this class was generated from the following files:
- Interface.hpp
- Interface.cpp