CatapultServer  v0.5.0.1 (Elephant)
NemesisBlockNotifier.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/functions.h"
23 
24 namespace catapult {
25  namespace cache { class CatapultCache; }
26  namespace io {
27  class BlockChangeSubscriber;
28  class BlockStorageCache;
29  }
30  namespace model {
31  struct BlockChainConfiguration;
32  struct BlockElement;
33  }
34  namespace plugins { class PluginManager; }
35  namespace subscribers { class StateChangeSubscriber; }
36 }
37 
38 namespace catapult { namespace local {
39 
42  public:
45  const model::BlockChainConfiguration& config,
46  const cache::CatapultCache& cache,
47  const io::BlockStorageCache& storage,
48  const plugins::PluginManager& pluginManager);
49 
50  public:
52  void raise(io::BlockChangeSubscriber& subscriber);
53 
55  void raise(subscribers::StateChangeSubscriber& subscriber);
56 
57  private:
58  void raise(const consumer<model::BlockElement>& action);
59 
60  private:
65  };
66 }}
catapult::local::NemesisBlockNotifier::m_storage
const io::BlockStorageCache & m_storage
Definition: NemesisBlockNotifier.h:63
catapult::local::NemesisBlockNotifier::raise
void raise(io::BlockChangeSubscriber &subscriber)
Raises and forwards block change notifications to subscriber.
Definition: NemesisBlockNotifier.cpp:57
catapult::model::BlockChainConfiguration
Block chain configuration settings.
Definition: BlockChainConfiguration.h:33
catapult::io::BlockChangeSubscriber::notifyBlock
virtual void notifyBlock(const model::BlockElement &blockElement)=0
Indicates blockElement was saved.
catapult::extensions::NemesisBlockLoader
Loads and executes a nemesis block.
Definition: NemesisBlockLoader.h:50
catapult::Height
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
catapult::subscribers::StateChangeSubscriber
State change subscriber.
Definition: StateChangeSubscriber.h:31
BlockChangeSubscriber.h
m_storage
const io::BlockStorageCache & m_storage
Definition: LocalChainApi.cpp:57
functions.h
catapult::plugins::PluginManager
A manager for registering plugins.
Definition: PluginManager.h:51
catapult::io::BlockChangeSubscriber
Block change subscriber.
Definition: BlockChangeSubscriber.h:27
StateChangeInfo.h
catapult::local::NemesisBlockNotifier::m_pluginManager
const plugins::PluginManager & m_pluginManager
Definition: NemesisBlockNotifier.h:64
catapult::cache::CacheChanges
Provides common view of aggregate cache changes.
Definition: CacheChanges.h:111
catapult::io::BlockStorageCache::view
BlockStorageView view() const
Gets a read only view of the storage.
Definition: BlockStorageCache.cpp:176
catapult::local::NemesisBlockNotifier::m_config
const model::BlockChainConfiguration & m_config
Definition: NemesisBlockNotifier.h:61
catapult::local::NemesisBlockNotifier
Raises nemesis block notifications.
Definition: NemesisBlockNotifier.h:41
catapult::io::BlockStorageCache
Definition: BlockStorageCache.h:97
catapult::subscribers::StateChangeSubscriber::notifyScoreChange
virtual void notifyScoreChange(const model::ChainScore &chainScore)=0
Indicates chain score was changed to chainScore.
catapult::cache::CatapultCache
Central cache holding all sub caches.
Definition: CatapultCache.h:40
m_pluginManager
plugins::PluginManager & m_pluginManager
Definition: Broker.cpp:123
size
uint64_t size
Definition: MemoryCounters.cpp:65
ChainScore.h
CacheChanges.h
m_config
HarvestingConfiguration m_config
Definition: HarvestingService.cpp:126
catapult::action
std::function< void()> action
An action function.
Definition: functions.h:27
CatapultCache.h
AccountStateCache.h
CATAPULT_THROW_RUNTIME_ERROR
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
PluginManager.h
ChainScore
model::ChainScore ChainScore
Definition: tools/health/main.cpp:43
catapult
Definition: AddressExtractionExtension.cpp:28
NemesisBlockLoader.h
catapult::local::NemesisBlockNotifier::m_cache
const cache::CatapultCache & m_cache
Definition: NemesisBlockNotifier.h:62
catapult::local::NemesisBlockNotifier::NemesisBlockNotifier
NemesisBlockNotifier(const model::BlockChainConfiguration &config, const cache::CatapultCache &cache, const io::BlockStorageCache &storage, const plugins::PluginManager &pluginManager)
Creates a notifier around config, cache, storage and pluginManager.
Definition: NemesisBlockNotifier.cpp:46
BlockStorageCache.h
NemesisBlockNotifier.h
catapult::consumer
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
StateChangeSubscriber.h
m_cache
const cache::CatapultCache & m_cache
Definition: JointValidator.cpp:84
catapult::subscribers::StateChangeSubscriber::notifyStateChange
virtual void notifyStateChange(const StateChangeInfo &stateChangeInfo)=0
Indicates state was changed with change information in stateChangeInfo.
catapult::extensions::NemesisBlockLoader::execute
void execute(const LocalNodeStateRef &stateRef, StateHashVerification stateHashVerification)
Loads the nemesis block from storage, updates state in stateRef and verifies state hash (stateHashVer...
Definition: NemesisBlockLoader.cpp:152