2017-11-09 19:34:51 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
|
|
|
|
* Copyright (C) 2015 The Bitcoin Core developers
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2014-11-18 12:06:32 -05:00
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#ifndef FLOWEE_ZMQ_ZMQABSTRACTNOTIFIER_H
|
|
|
|
|
#define FLOWEE_ZMQ_ZMQABSTRACTNOTIFIER_H
|
2014-11-18 12:06:32 -05:00
|
|
|
|
|
|
|
|
#include "zmqconfig.h"
|
|
|
|
|
|
2015-09-16 16:42:23 +02:00
|
|
|
class CBlockIndex;
|
2014-11-18 12:06:32 -05:00
|
|
|
class CZMQAbstractNotifier;
|
2015-09-16 16:42:23 +02:00
|
|
|
|
2014-11-18 12:06:32 -05:00
|
|
|
typedef CZMQAbstractNotifier* (*CZMQNotifierFactory)();
|
|
|
|
|
|
|
|
|
|
class CZMQAbstractNotifier
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CZMQAbstractNotifier() : psocket(0) { }
|
|
|
|
|
virtual ~CZMQAbstractNotifier();
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
static CZMQAbstractNotifier* Create()
|
|
|
|
|
{
|
|
|
|
|
return new T();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string GetType() const { return type; }
|
|
|
|
|
void SetType(const std::string &t) { type = t; }
|
|
|
|
|
std::string GetAddress() const { return address; }
|
|
|
|
|
void SetAddress(const std::string &a) { address = a; }
|
|
|
|
|
|
|
|
|
|
virtual bool Initialize(void *pcontext) = 0;
|
|
|
|
|
virtual void Shutdown() = 0;
|
|
|
|
|
|
2015-09-16 16:42:23 +02:00
|
|
|
virtual bool NotifyBlock(const CBlockIndex *pindex);
|
2014-11-18 12:06:32 -05:00
|
|
|
virtual bool NotifyTransaction(const CTransaction &transaction);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void *psocket;
|
|
|
|
|
std::string type;
|
|
|
|
|
std::string address;
|
|
|
|
|
};
|
|
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#endif
|