CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 namespace catapult {
namespace model {
29 template<
typename TPlugin,
typename TPluginKey>
39 auto iter = std::find_if(
m_plugins.cbegin(),
m_plugins.cend(), [type](
const auto& pPlugin) {
40 return pPlugin->type() == type;
43 return m_plugins.cend() == iter ? nullptr : iter->get();
56 std::vector<std::unique_ptr<const TPlugin>>
m_plugins;
const TPlugin * findPlugin(TPluginKey type) const
Finds the plugin corresponding to type or nullptr if none is registered.
Definition: PluginRegistry.h:38
size_t size() const
Gets the number of registered plugins.
Definition: PluginRegistry.h:33
A registry of plugins.
Definition: PluginRegistry.h:30
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
std::vector< std::unique_ptr< const TPlugin > > m_plugins
Definition: PluginRegistry.h:56
Definition: AddressExtractionExtension.cpp:28
void registerPlugin(std::unique_ptr< const TPlugin > &&pPlugin)
Registers pPlugin with the registry.
Definition: PluginRegistry.h:48