CatapultServer  v0.5.0.1 (Elephant)
catapult::subscribers::SubscriptionManager Class Reference

A manager for subscribing to notifications. More...

Collaboration diagram for catapult::subscribers::SubscriptionManager:

Public Member Functions

 SubscriptionManager (const config::CatapultConfiguration &config)
 Creates a new subscription manager around config. More...
 
io::BlockStoragefileStorage ()
 Gets the underlying file storage. More...
 
void addBlockChangeSubscriber (std::unique_ptr< io::BlockChangeSubscriber > &&pSubscriber)
 Registers a block change subscriber (pSubscriber). More...
 
void addUtChangeSubscriber (std::unique_ptr< cache::UtChangeSubscriber > &&pSubscriber)
 Registers an unconfirmed transactions change subscriber (pSubscriber). More...
 
void addPtChangeSubscriber (std::unique_ptr< cache::PtChangeSubscriber > &&pSubscriber)
 Registers a partial transactions change subscriber (pSubscriber). More...
 
void addTransactionStatusSubscriber (std::unique_ptr< TransactionStatusSubscriber > &&pSubscriber)
 Adds a transaction status subscriber (pSubscriber). More...
 
void addStateChangeSubscriber (std::unique_ptr< StateChangeSubscriber > &&pSubscriber)
 Adds a state change subscriber (pSubscriber). More...
 
void addNodeSubscriber (std::unique_ptr< NodeSubscriber > &&pSubscriber)
 Adds a node subscriber (pSubscriber). More...
 
std::unique_ptr< io::BlockChangeSubscribercreateBlockChangeSubscriber ()
 Creates the block change subscriber. More...
 
std::unique_ptr< cache::UtChangeSubscribercreateUtChangeSubscriber ()
 Creates the ut change subscriber. More...
 
std::unique_ptr< cache::PtChangeSubscribercreatePtChangeSubscriber ()
 Creates the pt change subscriber. More...
 
std::unique_ptr< TransactionStatusSubscribercreateTransactionStatusSubscriber ()
 Creates the transaction status subscriber. More...
 
std::unique_ptr< StateChangeSubscribercreateStateChangeSubscriber ()
 Creates the state change subscriber. More...
 
std::unique_ptr< NodeSubscribercreateNodeSubscriber ()
 Creates the node subscriber. More...
 
std::unique_ptr< io::BlockStoragecreateBlockStorage (io::BlockChangeSubscriber *&pSubscriber)
 
std::unique_ptr< cache::MemoryUtCacheProxycreateUtCache (const cache::MemoryCacheOptions &options)
 
std::unique_ptr< cache::MemoryPtCacheProxycreatePtCache (const cache::MemoryCacheOptions &options)
 

Private Types

enum  SubscriberType : uint32_t {
  SubscriberType::BlockChange, SubscriberType::UtChange, SubscriberType::PtChange, SubscriberType::TransactionStatus,
  SubscriberType::StateChange, SubscriberType::Node, SubscriberType::Count
}
 

Private Member Functions

void requireUnused (SubscriberType subscriberType) const
 
void markUsed (SubscriberType subscriberType)
 

Private Attributes

const config::CatapultConfigurationm_config
 
std::unique_ptr< io::FileBlockStoragem_pStorage
 
std::array< bool, utils::to_underlying_type(SubscriberType::Count)> m_subscriberUsedFlags
 
std::vector< std::unique_ptr< io::BlockChangeSubscriber > > m_blockChangeSubscribers
 
std::vector< std::unique_ptr< cache::UtChangeSubscriber > > m_utChangeSubscribers
 
std::vector< std::unique_ptr< cache::PtChangeSubscriber > > m_ptChangeSubscribers
 
std::vector< std::unique_ptr< TransactionStatusSubscriber > > m_transactionStatusSubscribers
 
std::vector< std::unique_ptr< StateChangeSubscriber > > m_stateChangeSubscribers
 
std::vector< std::unique_ptr< NodeSubscriber > > m_nodeSubscribers
 

Detailed Description

A manager for subscribing to notifications.

Member Enumeration Documentation

◆ SubscriberType

Enumerator
BlockChange 
UtChange 
PtChange 
TransactionStatus 
StateChange 
Node 
Count 

Constructor & Destructor Documentation

◆ SubscriptionManager()

catapult::subscribers::SubscriptionManager::SubscriptionManager ( const config::CatapultConfiguration config)
explicit

Creates a new subscription manager around config.

Member Function Documentation

◆ addBlockChangeSubscriber()

void catapult::subscribers::SubscriptionManager::addBlockChangeSubscriber ( std::unique_ptr< io::BlockChangeSubscriber > &&  pSubscriber)

Registers a block change subscriber (pSubscriber).

Here is the call graph for this function:

◆ addNodeSubscriber()

void catapult::subscribers::SubscriptionManager::addNodeSubscriber ( std::unique_ptr< NodeSubscriber > &&  pSubscriber)

Adds a node subscriber (pSubscriber).

Here is the call graph for this function:

◆ addPtChangeSubscriber()

void catapult::subscribers::SubscriptionManager::addPtChangeSubscriber ( std::unique_ptr< cache::PtChangeSubscriber > &&  pSubscriber)

Registers a partial transactions change subscriber (pSubscriber).

Here is the call graph for this function:

◆ addStateChangeSubscriber()

void catapult::subscribers::SubscriptionManager::addStateChangeSubscriber ( std::unique_ptr< StateChangeSubscriber > &&  pSubscriber)

Adds a state change subscriber (pSubscriber).

Here is the call graph for this function:

◆ addTransactionStatusSubscriber()

void catapult::subscribers::SubscriptionManager::addTransactionStatusSubscriber ( std::unique_ptr< TransactionStatusSubscriber > &&  pSubscriber)

Adds a transaction status subscriber (pSubscriber).

Here is the call graph for this function:

◆ addUtChangeSubscriber()

void catapult::subscribers::SubscriptionManager::addUtChangeSubscriber ( std::unique_ptr< cache::UtChangeSubscriber > &&  pSubscriber)

Registers an unconfirmed transactions change subscriber (pSubscriber).

Here is the call graph for this function:

◆ createBlockChangeSubscriber()

std::unique_ptr< io::BlockChangeSubscriber > catapult::subscribers::SubscriptionManager::createBlockChangeSubscriber ( )

Creates the block change subscriber.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createBlockStorage()

std::unique_ptr< io::BlockStorage > catapult::subscribers::SubscriptionManager::createBlockStorage ( io::BlockChangeSubscriber *&  pSubscriber)

Creates the block storage and sets pSubscriber to the created block change subscriber.

Note
createBlockChangeSubscriber cannot be called if this function is called.
Here is the call graph for this function:

◆ createNodeSubscriber()

std::unique_ptr< NodeSubscriber > catapult::subscribers::SubscriptionManager::createNodeSubscriber ( )

Creates the node subscriber.

Here is the call graph for this function:

◆ createPtCache()

std::unique_ptr< cache::MemoryPtCacheProxy > catapult::subscribers::SubscriptionManager::createPtCache ( const cache::MemoryCacheOptions options)

Creates the partial transactions cache with the specified cache options.

Note
createPtChangeSubscriber cannot be called if this function is called.
Here is the call graph for this function:

◆ createPtChangeSubscriber()

std::unique_ptr< cache::PtChangeSubscriber > catapult::subscribers::SubscriptionManager::createPtChangeSubscriber ( )

Creates the pt change subscriber.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createStateChangeSubscriber()

std::unique_ptr< StateChangeSubscriber > catapult::subscribers::SubscriptionManager::createStateChangeSubscriber ( )

Creates the state change subscriber.

Here is the call graph for this function:

◆ createTransactionStatusSubscriber()

std::unique_ptr< TransactionStatusSubscriber > catapult::subscribers::SubscriptionManager::createTransactionStatusSubscriber ( )

Creates the transaction status subscriber.

Here is the call graph for this function:

◆ createUtCache()

std::unique_ptr< cache::MemoryUtCacheProxy > catapult::subscribers::SubscriptionManager::createUtCache ( const cache::MemoryCacheOptions options)

Creates the unconfirmed transactions cache with the specified cache options.

Note
createUtChangeSubscriber cannot be called if this function is called.
Here is the call graph for this function:

◆ createUtChangeSubscriber()

std::unique_ptr< cache::UtChangeSubscriber > catapult::subscribers::SubscriptionManager::createUtChangeSubscriber ( )

Creates the ut change subscriber.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileStorage()

io::BlockStorage & catapult::subscribers::SubscriptionManager::fileStorage ( )

Gets the underlying file storage.

◆ markUsed()

void catapult::subscribers::SubscriptionManager::markUsed ( SubscriberType  subscriberType)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ requireUnused()

void catapult::subscribers::SubscriptionManager::requireUnused ( SubscriberType  subscriberType) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_blockChangeSubscribers

std::vector<std::unique_ptr<io::BlockChangeSubscriber> > catapult::subscribers::SubscriptionManager::m_blockChangeSubscribers
private

◆ m_config

const config::CatapultConfiguration& catapult::subscribers::SubscriptionManager::m_config
private

◆ m_nodeSubscribers

std::vector<std::unique_ptr<NodeSubscriber> > catapult::subscribers::SubscriptionManager::m_nodeSubscribers
private

◆ m_pStorage

std::unique_ptr<io::FileBlockStorage> catapult::subscribers::SubscriptionManager::m_pStorage
private

◆ m_ptChangeSubscribers

std::vector<std::unique_ptr<cache::PtChangeSubscriber> > catapult::subscribers::SubscriptionManager::m_ptChangeSubscribers
private

◆ m_stateChangeSubscribers

std::vector<std::unique_ptr<StateChangeSubscriber> > catapult::subscribers::SubscriptionManager::m_stateChangeSubscribers
private

◆ m_subscriberUsedFlags

std::array<bool, utils::to_underlying_type(SubscriberType::Count)> catapult::subscribers::SubscriptionManager::m_subscriberUsedFlags
private

◆ m_transactionStatusSubscribers

std::vector<std::unique_ptr<TransactionStatusSubscriber> > catapult::subscribers::SubscriptionManager::m_transactionStatusSubscribers
private

◆ m_utChangeSubscribers

std::vector<std::unique_ptr<cache::UtChangeSubscriber> > catapult::subscribers::SubscriptionManager::m_utChangeSubscribers
private

The documentation for this class was generated from the following files: