PRCYCoin  2.0.0.7rc1
P2P Digital Currency
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 "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  virtual bool NotifyTransactionLock(const CTransaction &transaction);
38 
39 protected:
40  void *psocket;
41  std::string type;
42  std::string address;
43 };
44 
45 #endif // BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H
CZMQAbstractNotifier::NotifyTransactionLock
virtual bool NotifyTransactionLock(const CTransaction &transaction)
Definition: zmqabstractnotifier.cpp:24
CZMQAbstractNotifier::type
std::string type
Definition: zmqabstractnotifier.h:41
CTransaction
The basic transaction that is broadcasted on the network and contained in blocks.
Definition: transaction.h:269
CZMQAbstractNotifier
Definition: zmqabstractnotifier.h:15
CZMQAbstractNotifier::Shutdown
virtual void Shutdown()=0
CZMQAbstractNotifier::psocket
void * psocket
Definition: zmqabstractnotifier.h:40
CZMQAbstractNotifier::SetAddress
void SetAddress(const std::string &a)
Definition: zmqabstractnotifier.h:30
zmqconfig.h
CZMQAbstractNotifier::SetType
void SetType(const std::string &t)
Definition: zmqabstractnotifier.h:28
CZMQAbstractNotifier::GetType
std::string GetType() const
Definition: zmqabstractnotifier.h:27
CZMQAbstractNotifier::~CZMQAbstractNotifier
virtual ~CZMQAbstractNotifier()
Definition: zmqabstractnotifier.cpp:9
CZMQAbstractNotifier::Initialize
virtual bool Initialize(void *pcontext)=0
CZMQAbstractNotifier::address
std::string address
Definition: zmqabstractnotifier.h:42
CZMQAbstractNotifier::Create
static CZMQAbstractNotifier * Create()
Definition: zmqabstractnotifier.h:22
CZMQAbstractNotifier::NotifyTransaction
virtual bool NotifyTransaction(const CTransaction &transaction)
Definition: zmqabstractnotifier.cpp:19
CZMQAbstractNotifier::GetAddress
std::string GetAddress() const
Definition: zmqabstractnotifier.h:29
CZMQAbstractNotifier::CZMQAbstractNotifier
CZMQAbstractNotifier()
Definition: zmqabstractnotifier.h:18
CZMQAbstractNotifier::NotifyBlock
virtual bool NotifyBlock(const CBlockIndex *pindex)
Definition: zmqabstractnotifier.cpp:14
CBlockIndex
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:162