CatapultServer  v0.5.0.1 (Elephant)
ExtensionManager.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "ServiceRegistrar.h"
23 #include "catapult/functions.h"
24 #include "catapult/types.h"
25 #include <memory>
26 #include <vector>
27 
28 namespace catapult { namespace cache { class CatapultCache; } }
29 
30 namespace catapult { namespace extensions {
31 
34  public:
37 
38  public:
41 
42  public:
44  void registerSystemPlugin(const std::string& name);
45 
48 
50  void addServiceRegistrar(std::unique_ptr<ServiceRegistrar>&& pServiceRegistrar);
51 
52  public:
54  const std::vector<std::string>& systemPluginNames() const;
55 
58 
60  void registerServices(ServiceLocator& locator, ServiceState& state);
61 
62  private:
63  std::vector<std::string> m_systemPluginNames;
65  std::vector<std::unique_ptr<ServiceRegistrar>> m_serviceRegistrars;
66  };
67 }}
catapult::extensions::ExtensionManager::setNetworkTimeSupplier
void setNetworkTimeSupplier(const NetworkTimeSupplier &supplier)
Registers a network time supplier.
Definition: ExtensionManager.cpp:38
catapult::extensions::ExtensionManager::NetworkTimeSupplier
supplier< Timestamp > NetworkTimeSupplier
Supplier that returns the network time.
Definition: ExtensionManager.h:36
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
ServiceRegistrar.h
Parser.debug
def debug(*args)
Definition: Parser.py:46
BasicServerHooks.h
catapult::extensions::ExtensionManager::addServiceRegistrar
void addServiceRegistrar(std::unique_ptr< ServiceRegistrar > &&pServiceRegistrar)
Adds a service registrar (pServiceRegistrar).
Definition: ExtensionManager.cpp:42
catapult::extensions::ExtensionManager::systemPluginNames
const std::vector< std::string > & systemPluginNames() const
Gets the system plugin names.
Definition: ExtensionManager.cpp:46
catapult::observers::DEFINE_OBSERVER
DEFINE_OBSERVER(AccountAddress, model::AccountAddressNotification, [](const auto &notification, const auto &context) { DefaultAccountVisitor visitor(context);visitor.visit(notification.Address);})
catapult::extensions::SetOnce
void SetOnce(TFunc &dest, const TFunc &source)
Sets dest to source if and only if dest is unset.
Definition: BasicServerHooks.h:29
Observers.h
functions.h
catapult::utils::to_underlying_type
constexpr std::underlying_type_t< TEnum > to_underlying_type(TEnum value)
Converts a strongly typed enumeration value to its underlying integral value.
Definition: Casting.h:37
catapult::extensions::ExtensionManager::m_networkTimeSupplier
NetworkTimeSupplier m_networkTimeSupplier
Definition: ExtensionManager.h:64
ObserverUtils.h
catapult::supplier
std::function< T()> supplier
A (stateless) supplier function.
Definition: functions.h:39
catapult::extensions::ExtensionManager::networkTimeSupplier
NetworkTimeSupplier networkTimeSupplier() const
Gets the network time supplier.
Definition: ExtensionManager.cpp:50
catapult::extensions::ServiceState
State that is used as part of service registration.
Definition: ServiceState.h:51
catapult::extensions::ExtensionManager::registerSystemPlugin
void registerSystemPlugin(const std::string &name)
Registers a system plugin with name.
Definition: ExtensionManager.cpp:34
catapult::extensions::ExtensionManager
A manager for registering extensions.
Definition: ExtensionManager.h:33
types.h
catapult::extensions::ExtensionManager::m_systemPluginNames
std::vector< std::string > m_systemPluginNames
Definition: ExtensionManager.h:63
catapult::extensions::ExtensionManager::registerServices
void registerServices(ServiceLocator &locator, ServiceState &state)
Registers all services by forwarding locator and state.
Definition: ExtensionManager.cpp:54
Casting.h
NetworkTime.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::extensions::ExtensionManager::ExtensionManager
ExtensionManager()
Creates a manager.
Definition: ExtensionManager.cpp:28
catapult::extensions::ExtensionManager::m_serviceRegistrars
std::vector< std::unique_ptr< ServiceRegistrar > > m_serviceRegistrars
Definition: ExtensionManager.h:65
ExtensionManager.h
catapult::utils::NetworkTime
Timestamp NetworkTime()
Returns the network time, i.e. the number of milliseconds since Epoch_Time.
Definition: NetworkTime.cpp:27
SecretLockInfoCache.h
catapult::extensions::ServiceLocator
A service locator for local node services.
Definition: ServiceLocator.h:33
ExpiredLockInfoObserver.h