Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

zmqabstractnotifier.h
Go to the documentation of this file.
1 // Copyright (c) 2015 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_ZMQABSTRACTNOTIFIER_H
6 #define BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H
7 
8 #include <zmq/zmqconfig.h>
9 
10 class CBlockIndex;
11 class CGovernanceObject;
12 class CGovernanceVote;
14 
15 namespace llmq {
16  class CChainLockSig;
17  class CInstantSendLock;
18 } // namespace llmq
19 
20 typedef CZMQAbstractNotifier* (*CZMQNotifierFactory)();
21 
23 {
24 public:
25  CZMQAbstractNotifier() : psocket(nullptr) { }
26  virtual ~CZMQAbstractNotifier();
27 
28  template <typename T>
30  {
31  return new T();
32  }
33 
34  std::string GetType() const { return type; }
35  void SetType(const std::string &t) { type = t; }
36  std::string GetAddress() const { return address; }
37  void SetAddress(const std::string &a) { address = a; }
38 
39  virtual bool Initialize(void *pcontext) = 0;
40  virtual void Shutdown() = 0;
41 
42  virtual bool NotifyBlock(const CBlockIndex *pindex);
43  virtual bool NotifyChainLock(const CBlockIndex *pindex, const llmq::CChainLockSig& clsig);
44  virtual bool NotifyTransaction(const CTransaction &transaction);
45  virtual bool NotifyTransactionLock(const CTransaction &transaction, const llmq::CInstantSendLock& islock);
46  virtual bool NotifyGovernanceVote(const CGovernanceVote &vote);
47  virtual bool NotifyGovernanceObject(const CGovernanceObject &object);
48  virtual bool NotifyInstantSendDoubleSpendAttempt(const CTransaction &currentTx, const CTransaction &previousTx);
49 
50 
51 protected:
52  void *psocket;
53  std::string type;
54  std::string address;
55 };
56 
57 #endif // BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H
virtual bool NotifyTransactionLock(const CTransaction &transaction, const llmq::CInstantSendLock &islock)
Governance Object.
virtual bool NotifyGovernanceObject(const CGovernanceObject &object)
virtual bool NotifyBlock(const CBlockIndex *pindex)
std::string GetAddress() const
virtual bool NotifyInstantSendDoubleSpendAttempt(const CTransaction &currentTx, const CTransaction &previousTx)
virtual bool NotifyTransaction(const CTransaction &transaction)
void SetAddress(const std::string &a)
virtual void Shutdown()=0
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:170
virtual bool Initialize(void *pcontext)=0
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:198
virtual bool NotifyChainLock(const CBlockIndex *pindex, const llmq::CChainLockSig &clsig)
void SetType(const std::string &t)
std::string GetType() const
virtual bool NotifyGovernanceVote(const CGovernanceVote &vote)
static CZMQAbstractNotifier * Create()
Released under the MIT license