aboutsummaryrefslogtreecommitdiff
path: root/include/INode.h
diff options
context:
space:
mode:
authorAntonio Juarez <antonio.maria.juarez@live.com>2014-04-07 16:02:15 +0100
committerAntonio Juarez <antonio.maria.juarez@live.com>2014-04-07 16:02:15 +0100
commita401a02ddb3fb045d998cf650292cab3b3ebfd58 (patch)
tree61d021af997193aba90b95b70836c2d031334aff /include/INode.h
parentjson rpc for wallet and bugfix (diff)
downloadmonero-a401a02ddb3fb045d998cf650292cab3b3ebfd58.tar.xz
Improvements in JSON RPC
Diffstat (limited to 'include/INode.h')
-rw-r--r--include/INode.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/INode.h b/include/INode.h
new file mode 100644
index 000000000..bd35dccc5
--- /dev/null
+++ b/include/INode.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2012-2013 The Cryptonote developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#pragma once
+
+#include <cstdint>
+#include <system_error>
+
+namespace cryptonote {
+
+class INodeObserver {
+public:
+ virtual void initCompleted(std::error_code result) {}
+
+ virtual void peerCountUpdated(size_t count) {}
+ virtual void lastLocalBlockHeightUpdated(uint64_t height) {}
+ virtual void lastKnownBlockHeightUpdated(uint64_t height) {}
+
+ virtual void blockchainReorganized(uint64_t height) {}
+};
+
+class INode {
+public:
+ virtual ~INode() = 0;
+ virtual void init() = 0;
+ virtual void shutdown() = 0;
+
+ virtual void addObserver(INodeObserver* observer) = 0;
+ virtual void removeObserver(INodeObserver* observer) = 0;
+
+ virtual size_t getPeerCount() = 0;
+ virtual uint64_t getLastLocalBlockHeight() = 0;
+ virtual uint64_t getLastKnownBlockHeight() = 0;
+};
+
+}