CatapultServer  v0.5.0.1 (Elephant)
NotificationPublisher.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "WeakEntityInfo.h"
23 
24 namespace catapult {
25  namespace model {
26  class NotificationSubscriber;
27  class TransactionRegistry;
28  }
29 }
30 
31 namespace catapult { namespace model {
32 
34  enum class PublicationMode {
36  Basic,
37 
39  Custom,
40 
42  All
43  };
44 
47  public:
48  virtual ~NotificationPublisher() = default;
49 
50  public:
52  virtual void publish(const WeakEntityInfo& entityInfo, NotificationSubscriber& sub) const = 0;
53  };
54 
57  std::unique_ptr<NotificationPublisher> CreateNotificationPublisher(
58  const TransactionRegistry& transactionRegistry,
59  UnresolvedMosaicId feeMosaicId,
61 }}
Block.h
NotificationPublisher.h
catapult::model::BasicEntityType::Block
Block type.
m_transactionRegistry
const TransactionRegistry & m_transactionRegistry
Definition: NotificationPublisher.cpp:143
catapult::Hash256
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
catapult::model::NotificationSubscriber
A notification subscriber.
Definition: NotificationSubscriber.h:27
catapult::model::BlockHeader::Current_Version
static constexpr int Current_Version
Block format version.
Definition: Block.h:37
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
NotificationSubscriber.h
WeakEntityInfo.h
catapult::model::EntityType
EntityType
Enumeration of entity types.
Definition: EntityType.h:43
m_customPublisher
CustomNotificationPublisher m_customPublisher
Definition: NotificationPublisher.cpp:187
m_basicPublisher
BasicNotificationPublisher m_basicPublisher
Definition: NotificationPublisher.cpp:186
catapult::model::VerifiableEntityHeader::Header_Size
static constexpr size_t Header_Size
Size of the VerifiableEntity part that can be skipped when signing/verifying.
Definition: VerifiableEntity.h:38
catapult::model::NotificationPublisher::publish
virtual void publish(const WeakEntityInfo &entityInfo, NotificationSubscriber &sub) const =0
Sends all notifications from entityInfo to sub.
catapult::UnresolvedMosaicId
utils::BaseValue< uint64_t, UnresolvedMosaicId_tag > UnresolvedMosaicId
Definition: src/catapult/types.h:82
catapult::model::ToBasicEntityType
constexpr BasicEntityType ToBasicEntityType(EntityType type)
Converts an entity type into a basic entity type.
Definition: EntityType.h:70
catapult::model::PublicationMode::Custom
Only custom notifications are published.
catapult::model::PublicationMode::Basic
Only basic notifications are published.
catapult::utils::BaseValue< uint64_t, UnresolvedMosaicId_tag >
catapult::model::NotificationPublisher::~NotificationPublisher
virtual ~NotificationPublisher()=default
CATAPULT_THROW_RUNTIME_ERROR_1
#define CATAPULT_THROW_RUNTIME_ERROR_1(MESSAGE, PARAM1)
Macro used to throw a catapult runtime error with a single parameter.
Definition: exceptions.h:171
catapult::model::WeakEntityInfoT
Wrapper around a strongly typed entity and its associated metadata.
Definition: WeakEntityInfo.h:33
TransactionPlugin.h
m_feeMosaicId
UnresolvedMosaicId m_feeMosaicId
Definition: NotificationPublisher.cpp:144
catapult::model::SignatureNotification::ReplayProtectionMode::Enabled
catapult::model::BasicEntityType::Other
Some other type.
catapult::model::NotificationPublisher
A notification publisher.
Definition: NotificationPublisher.h:46
catapult::model::AccountRestrictionType::Block
Account restriction is interpreted as blocking operation.
FeeUtils.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::TransactionRegistry
A registry of transaction plugins.
Definition: TransactionPlugin.h:98
catapult::model::CreateNotificationPublisher
std::unique_ptr< NotificationPublisher > CreateNotificationPublisher(const TransactionRegistry &transactionRegistry, UnresolvedMosaicId feeMosaicId, PublicationMode mode)
Definition: NotificationPublisher.cpp:191
catapult::model::MosaicFlags::All
All flags.
catapult::validators::BalanceDebitNotification
model::BalanceDebitNotification BalanceDebitNotification
Definition: BalanceValidator.cpp:29
catapult::model::CalculateBlockTransactionsInfo
BlockTransactionsInfo CalculateBlockTransactionsInfo(const Block &block)
Calculates information about transactions stored in block.
Definition: BlockUtils.cpp:75
catapult::model::BasicEntityType::Transaction
Transaction type.
catapult::model::CalculateTransactionFee
Amount CalculateTransactionFee(BlockFeeMultiplier feeMultiplier, const Transaction &transaction)
Calculates the fee for transaction contained in block with feeMultiplier.
Definition: FeeUtils.cpp:26
catapult::model::PublicationMode
PublicationMode
Publication modes.
Definition: NotificationPublisher.h:34
catapult::Key
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41
catapult::model::BasicEntityType
BasicEntityType
Definition: EntityType.h:31
BlockUtils.h
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62