2 #include <score/plugins/InterfaceList.hpp>
4 #include <ossia/detail/hash_map.hpp>
5 #include <ossia/detail/small_vector.hpp>
7 #include <score_lib_process_export.h>
12 struct DocumentContext;
29 SCORE_INTERFACE(
OfflineAction,
"0d9e9135-bf4d-4ef2-b872-21be740f990c")
33 virtual QString title()
const noexcept = 0;
43 using OfflineActions = ossia::small_pod_vector<OfflineAction*, 4>;
45 using key_type =
typename OfflineAction::ConcreteKey;
56 return OfflineAction::static_interfaceKey();
61 return OfflineAction::static_interfaceKey();
64 void insert(std::unique_ptr<score::InterfaceBase> e)
final override
69 std::unique_ptr<factory_type> pf{result};
70 vector_type::push_back(pf.get());
71 actionsMap[result->target()].push_back(pf.get());
73 auto k = pf->concreteKey();
74 auto it = this->map.find(k);
75 if(it == this->map.end())
77 this->map.emplace(std::make_pair(k, std::move(pf)));
81 score::debug_types(it->second.get(), result);
82 it->second = std::move(pf);
85 added(vector_type::back());
92 auto it = this->map.find(k);
93 return (it != this->map.end()) ? it->second.get() :
nullptr;
96 mutable Nano::Signal<void(
const factory_type&)> added;
99 ossia::hash_map<typename OfflineAction::ConcreteKey, std::unique_ptr<OfflineAction>>
102 ossia::hash_map<UuidKey<Process::ProcessModel>, OfflineActions> actionsMap;
107 this->map.max_load_factor(0.1f);
108 this->map.reserve(map.size());
Interface for applying an offline editing action to a process.
Definition: OfflineAction.hpp:28
Definition: OfflineAction.hpp:41
void optimize() noexcept final override
optimize Called when all the factories are loaded.
Definition: OfflineAction.hpp:104
OfflineAction * get(const key_type &k) const noexcept
Get a particular factory from its ConcreteKey.
Definition: OfflineAction.hpp:90
void insert(std::unique_ptr< score::InterfaceBase > e) final override
insert Register a new factory.
Definition: OfflineAction.hpp:64
constexpr score::InterfaceKey interfaceKey() const noexcept final override
A key that uniquely identifies this family of factories.
Definition: OfflineAction.hpp:59
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: IndirectContainer.hpp:129
Base class for plug-in interfaces.
Definition: Interface.hpp:52
InterfaceListBase Interface to access factories.
Definition: InterfaceList.hpp:29
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: DocumentContext.hpp:18