CatapultServer  v0.5.0.1 (Elephant)
ObserverContext.h
Go to the documentation of this file.
1 
21 #pragma once
26 #include <iosfwd>
27 
28 namespace catapult { namespace observers {
29 
30  // region NotifyMode
31 
32 #define NOTIFY_MODE_LIST \
33  /* Execute actions. */ \
34  ENUM_VALUE(Commit) \
35  \
36  /* Reverse actions. */ \
37  ENUM_VALUE(Rollback)
38 
39 #define ENUM_VALUE(LABEL) LABEL,
40  enum class NotifyMode {
43  };
44 #undef ENUM_VALUE
45 
47  std::ostream& operator<<(std::ostream& out, NotifyMode value);
48 
49  // endregion
50 
51  // region ObserverState
52 
54  struct ObserverState {
55  public:
58 
61 
62  public:
65 
68 
71  };
72 
73  // endregion
74 
75  // region ObserverContext
76 
78  struct ObserverContext {
79  public:
82  ObserverContext(const ObserverState& state, Height height, NotifyMode mode, const model::ResolverContext& resolvers);
83 
84  public:
87 
90 
93 
96 
99 
100  public:
103 
104  private:
106  };
107 
108  // endregion
109 }}
ResolverContext.h
catapult::observers::ObserverContext::StatementBuilder
ObserverStatementBuilder & StatementBuilder()
Statement builder.
Definition: ObserverContext.cpp:82
catapult::observers::ObserverState::Cache
cache::CatapultCacheDelta & Cache
Catapult cache.
Definition: ObserverContext.h:64
catapult::observers::ObserverContext::Cache
cache::CatapultCacheDelta & Cache
Catapult cache.
Definition: ObserverContext.h:86
catapult::observers::ObserverContext
Context passed to all the observers.
Definition: ObserverContext.h:78
catapult::observers::Bind
model::ResolverContext Bind(const model::ResolverContext &resolverContext, model::BlockStatementBuilder &statementBuilder)
Binds resolverContext to statementBuilder.
Definition: ObserverStatementBuilder.cpp:50
MacroBasedEnum.h
catapult::cache::CatapultCacheDelta
Delta on top of a catapult cache.
Definition: CatapultCacheDelta.h:31
CatapultState.h
catapult::model::ResolverContext
Context used to resolve unresolved types.
Definition: ResolverContext.h:28
catapult::observers::ObserverContext::m_statementBuilder
ObserverStatementBuilder m_statementBuilder
Definition: ObserverContext.h:105
catapult::observers::ObserverState::State
state::CatapultState & State
Catapult state.
Definition: ObserverContext.h:67
catapult::observers::NotifyMode
NotifyMode
Enumeration of possible notification modes.
Definition: ObserverContext.h:41
catapult::observers::ObserverState::pBlockStatementBuilder
model::BlockStatementBuilder * pBlockStatementBuilder
Optional block statement builder.
Definition: ObserverContext.h:70
ObserverStatementBuilder.h
catapult::utils::BaseValue< uint64_t, Height_tag >
ObserverContext.h
catapult::observers::ObserverState::ObserverState
ObserverState(cache::CatapultCacheDelta &cache, state::CatapultState &state)
Creates an observer state around cache and state.
Definition: ObserverContext.cpp:38
CatapultCacheDelta.h
catapult::observers::ObserverContext::Resolvers
const model::ResolverContext Resolvers
Alias resolvers.
Definition: ObserverContext.h:98
catapult::observers::ObserverState
Block independent mutable state passed to all observers.
Definition: ObserverContext.h:54
catapult::observers::ObserverContext::ObserverContext
ObserverContext(const ObserverState &state, Height height, NotifyMode mode, const model::ResolverContext &resolvers)
Definition: ObserverContext.cpp:69
catapult::model::BlockStatementBuilder
Collection of receipts scoped to a block.
Definition: BlockStatementBuilder.h:27
catapult::state::CatapultState
Stateful catapult information.
Definition: CatapultState.h:27
MacroBasedEnumIncludes.h
catapult::observers::ObserverContext::Mode
const NotifyMode Mode
Notification mode.
Definition: ObserverContext.h:95
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::observers::operator<<
std::ostream & operator<<(std::ostream &out, NotifyMode value)
Insertion operator for outputting value to out.
catapult::observers::NotifyMode::NOTIFY_MODE_LIST
catapult::observers::ObserverStatementBuilder
Facade on top of a block statement builder that is accessible by observers.
Definition: ObserverStatementBuilder.h:28
catapult::observers::ObserverContext::Height
const catapult::Height Height
Current height.
Definition: ObserverContext.h:92
catapult::observers::ObserverContext::State
state::CatapultState & State
Catapult state.
Definition: ObserverContext.h:89