InterfaceList Default implementation of InterfaceListBase. More...

Inheritance diagram for score::InterfaceList< FactoryType >:
score::InterfaceListBase score::IndirectContainer< FactoryType > score::GenericComponentFactoryList< Process::ProcessModel, Execution::Context, Execution::ProcessComponentFactory > score::GenericComponentFactoryList< Process::ProcessModel, score::DocumentContext, LocalTree::ProcessComponentFactory > score::MatchingFactory< DisplayedElementsToolPaletteFactory > score::MatchingFactory< InspectorWidgetFactory > score::MatchingFactory< TriggerCommandFactory > score::MatchingFactory< DisplayedElementsProvider > Execution::ProcessComponentFactoryList LocalTree::ProcessComponentFactoryList Scenario::DisplayedElementsToolPaletteFactoryList Inspector::InspectorWidgetList Scenario::Command::TriggerCommandFactoryList Scenario::DisplayedElementsProviderList

Detailed Description

template<typename 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 :

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 Types inherited from score::IndirectContainer< FactoryType >
using ctnr_t = std::vector< FactoryType *, std::allocator< FactoryType * > >
 
using value_type = 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. More...
 
FactoryType * get (const key_type &k) const noexcept
 Get a particular factory from its ConcreteKey.
 
- Public Member Functions inherited from score::InterfaceListBase
 InterfaceListBase (const InterfaceListBase &)=delete
 
 InterfaceListBase (InterfaceListBase &&)=delete
 
InterfaceListBaseoperator= (const InterfaceListBase &)=delete
 
InterfaceListBaseoperator= (InterfaceListBase &&)=delete
 
- Public Member Functions inherited from score::IndirectContainer< FactoryType >
auto begin () noexcept
 
auto begin () const noexcept
 
auto end () noexcept
 
auto end () const noexcept
 
auto rbegin () noexcept
 
auto rbegin () const noexcept
 
auto rend () noexcept
 
auto rend () const noexcept
 
auto cbegin () const noexcept
 
auto cend () const noexcept
 
auto size () const noexcept
 
auto empty () const noexcept
 
auto push_back (FactoryType *ptr)
 
auto & front () const noexcept
 
auto & back () const noexcept
 
auto & operator[] (int pos) noexcept
 
auto & operator[] (int pos) const noexcept
 

Static Public Member Functions

static constexpr const score::InterfaceKey static_interfaceKey () noexcept
 

Public Attributes

Nano::Signal< void(const factory_type &)> added
 

Protected Attributes

ossia::hash_map< typename FactoryType::ConcreteKey, std::unique_ptr< FactoryType > > map
 

Additional Inherited Members

- Static Public Attributes inherited from score::InterfaceListBase
static constexpr bool factory_list_tag = true
 

Member Function Documentation

◆ insert()

template<typename FactoryType >
void score::InterfaceList< FactoryType >::insert ( std::unique_ptr< score::InterfaceBase )
inlinefinaloverridevirtual

insert Register a new factory.

All the factories are registered upon loading.

Implements score::InterfaceListBase.


The documentation for this class was generated from the following file: