Bitcoin
zmqnotificationinterface.h
Go to the documentation of this file.
1 // Copyright (c) 2015-2018 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
6 #define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
7 
8 #include <validationinterface.h>
9 #include <string>
10 #include <map>
11 #include <list>
12 
13 class CBlockIndex;
15 
17 {
18 public:
20 
21  std::list<const CZMQAbstractNotifier*> GetActiveNotifiers() const;
22 
24 
25 protected:
26  bool Initialize();
27  void Shutdown();
28 
29  // CValidationInterface
30  void TransactionAddedToMempool(const CTransactionRef& tx) override;
31  void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;
32  void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) override;
33  void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
34 
35 private:
37 
38  void *pcontext;
39  std::list<CZMQAbstractNotifier*> notifiers;
40 };
41 
43 
44 #endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:408
bool Initialize()
Definition: zmqnotificationinterface.cpp:82
void Shutdown()
Definition: zmqnotificationinterface.cpp:123
Definition: zmqnotificationinterface.h:16
void BlockDisconnected(const std::shared_ptr< const CBlock > &pblock) override
Definition: zmqnotificationinterface.cpp:189
void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexConnected, const std::vector< CTransactionRef > &vtxConflicted) override
Definition: zmqnotificationinterface.cpp:181
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
Definition: zmqnotificationinterface.cpp:140
std::list< const CZMQAbstractNotifier * > GetActiveNotifiers() const
Definition: zmqnotificationinterface.cpp:31
Definition: zmqabstractnotifier.h:15
Definition: validationinterface.h:71
void * pcontext
Definition: zmqnotificationinterface.h:38
CZMQNotificationInterface()
Definition: zmqnotificationinterface.cpp:17
Definition: chain.h:139
CZMQNotificationInterface * g_zmq_notification_interface
Definition: zmqnotificationinterface.cpp:197
virtual ~CZMQNotificationInterface()
Definition: zmqnotificationinterface.cpp:21
void TransactionAddedToMempool(const CTransactionRef &tx) override
Definition: zmqnotificationinterface.cpp:160
static CZMQNotificationInterface * Create()
Definition: zmqnotificationinterface.cpp:40
std::list< CZMQAbstractNotifier * > notifiers
Definition: zmqnotificationinterface.h:39