2015-04-23 16:07:22 +00:00
|
|
|
// Copyright (c) 2011-2015 The Cryptonote developers
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
2014-09-15 10:48:45 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
2015-04-06 16:13:07 +00:00
|
|
|
#include "cryptonote_protocol/ICryptonoteProtocolObserver.h"
|
|
|
|
#include "cryptonote_protocol/ICryptonoteProtocolQuery.h"
|
2014-09-15 10:48:45 +00:00
|
|
|
|
2015-04-06 16:13:07 +00:00
|
|
|
class ICryptonoteProtocolQueryStub: public cryptonote::ICryptonoteProtocolQuery {
|
2014-09-15 10:48:45 +00:00
|
|
|
public:
|
2015-04-06 16:13:07 +00:00
|
|
|
ICryptonoteProtocolQueryStub() : peers(0), observedHeight(0) {}
|
2014-09-15 10:48:45 +00:00
|
|
|
|
2015-04-06 16:13:07 +00:00
|
|
|
virtual bool addObserver(cryptonote::ICryptonoteProtocolObserver* observer);
|
|
|
|
virtual bool removeObserver(cryptonote::ICryptonoteProtocolObserver* observer);
|
|
|
|
virtual uint64_t getObservedHeight() const;
|
|
|
|
virtual size_t getPeerCount() const;
|
|
|
|
void setPeerCount(uint32_t count);
|
|
|
|
void setObservedHeight(uint64_t height);
|
2014-09-15 10:48:45 +00:00
|
|
|
|
2015-04-06 16:13:07 +00:00
|
|
|
private:
|
|
|
|
size_t peers;
|
|
|
|
uint64_t observedHeight;
|
2014-09-15 10:48:45 +00:00
|
|
|
};
|
2015-04-06 16:13:07 +00:00
|
|
|
|