Fabcoin Core  0.16.2
P2P Digital Currency
zmqabstractnotifier.h
Go to the documentation of this file.
1 // Copyright (c) 2015-2017 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 FABCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H
6 #define FABCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H
7 
8 #include <zmq/zmqconfig.h>
9 
10 class CBlockIndex;
12 
13 typedef CZMQAbstractNotifier* (*CZMQNotifierFactory)();
14 
16 {
17 public:
19  virtual ~CZMQAbstractNotifier();
20 
21  template <typename T>
23  {
24  return new T();
25  }
26 
27  std::string GetType() const { return type; }
28  void SetType(const std::string &t) { type = t; }
29  std::string GetAddress() const { return address; }
30  void SetAddress(const std::string &a) { address = a; }
31 
32  virtual bool Initialize(void *pcontext) = 0;
33  virtual void Shutdown() = 0;
34 
35  virtual bool NotifyBlock(const CBlockIndex *pindex);
36  virtual bool NotifyTransaction(const CTransaction &transaction);
37 
38 protected:
39  void *psocket;
40  std::string type;
41  std::string address;
42 };
43 
44 #endif // FABCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H
#define T(i, x)
virtual bool NotifyBlock(const CBlockIndex *pindex)
#define nullptr
Definition: eqcuda.hpp:22
#define a(i)
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:177
std::string GetAddress() const
std::string GetType() const
virtual bool Initialize(void *pcontext)=0
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:275
void SetType(const std::string &t)
static CZMQAbstractNotifier * Create()