Loading...
Searching...
No Matches
score::InterfaceList< FactoryType > Class Template Reference
InterfaceList Default implementation of InterfaceListBase. More...
Inheritance diagram for score::InterfaceList< FactoryType >:
Detailed Description
template<typename FactoryType>
class score::InterfaceList< FactoryType >
class score::InterfaceList< FactoryType >
InterfaceList Default implementation of InterfaceListBase.
The factories are stored in a hash_map. Keys shall be UUIDs. This class can be used in range-based loops :
score::ApplicationContext& context = ...;
auto& iface_list = context.interfaces<MyInterfaceList>();
for(auto& iface : iface_list)
{
auto res = iface.do_something(...);
}
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
An implementation of an interface shall never be inserted twice.
Public Types | |
| using | factory_type = FactoryType |
| using | key_type = typename FactoryType::ConcreteKey |
| using | vector_type = IndirectContainer< FactoryType > |
Public Member Functions | |
| constexpr score::InterfaceKey | interfaceKey () const noexcept final override |
| A key that uniquely identifies this family of factories. | |
| void | insert (std::unique_ptr< score::InterfaceBase > e) final override |
| insert Register a new factory. | |
| FactoryType * | get (const key_type &k) const noexcept |
| Get a particular factory from its ConcreteKey. | |
| auto | begin () noexcept |
| auto | end () noexcept |
| auto | begin () const noexcept |
| auto | end () const noexcept |
| auto | cbegin () const noexcept |
| auto | cend () const noexcept |
Public Member Functions inherited from score::InterfaceListMain | |
| void | insert_base (std::unique_ptr< score::InterfaceBase > e, score::uuid_t k) |
| auto | reserve (std::size_t v) |
| auto | size () const noexcept |
| auto | empty () const noexcept |
| void | optimize () noexcept final override |
| optimize Called when all the factories are loaded. | |
Public Member Functions inherited from score::InterfaceListBase | |
| InterfaceListBase (const InterfaceListBase &)=delete | |
| InterfaceListBase (InterfaceListBase &&)=delete | |
| InterfaceListBase & | operator= (const InterfaceListBase &)=delete |
| InterfaceListBase & | operator= (InterfaceListBase &&)=delete |
Static Public Member Functions | |
| static const constexpr score::InterfaceKey | static_interfaceKey () noexcept |
Additional Inherited Members | |
Public Attributes inherited from score::InterfaceListMain | |
| Nano::Signal< void(const score::InterfaceBase &)> | added |
| ossia::hash_map< score::uuid_t, std::unique_ptr< score::InterfaceBase > > | map |
Static Public Attributes inherited from score::InterfaceListBase | |
| static constexpr bool | factory_list_tag = true |
Member Function Documentation
◆ insert()
template<typename FactoryType >
|
inlinefinaloverridevirtual |
insert Register a new factory.
All the factories are registered upon loading.
Implements score::InterfaceListBase.
◆ interfaceKey()
template<typename FactoryType >
|
inlineconstexprfinaloverridevirtualnoexcept |
A key that uniquely identifies this family of factories.
Implements score::InterfaceListBase.
The documentation for this class was generated from the following file:
Public Member Functions inherited from