iota.lib.cpp
IOTA C++ Library
get_node_info.hpp
1 //
2 // MIT License
3 //
4 // Copyright (c) 2017-2018 Thibault Martinez and Simon Ninon
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in all
14 // copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 // SOFTWARE.
23 //
24 //
25 
26 #pragma once
27 
28 #include <iota/api/responses/base.hpp>
29 #include <iota/types/trytes.hpp>
30 
31 namespace IOTA {
32 
33 namespace API {
34 
35 namespace Responses {
36 
44 class GetNodeInfo : public Base {
45 public:
69  explicit GetNodeInfo(const std::string& appName = "", const std::string& appVersion = "",
70  int64_t jreAvailableProcessors = 0, int64_t jreFreeMemory = 0,
71  int64_t jreMaxMemory = 0, int64_t jreTotalMemory = 0,
72  const Types::Trytes& latestMilestone = "", int64_t latestMilestoneIndex = 0,
73  const Types::Trytes& latestSolidSubtangleMilestone = "",
74  int64_t latestSolidSubtangleMilestoneIndex = 0, int64_t neighbors = 0,
75  int64_t packetsQueueSize = 0, int64_t time = 0, int64_t tips = 0,
76  int64_t transactionsToRequest = 0);
77 
83  explicit GetNodeInfo(const json& res);
84 
88  ~GetNodeInfo() = default;
89 
90 public:
96  void deserialize(const json& res) override;
97 
98 public:
103  const std::string& getAppName() const;
104 
108  const std::string& getAppVersion() const;
109 
113  const int64_t& getJreAvailableProcessors() const;
114 
118  const int64_t& getJreFreeMemory() const;
119 
123  const int64_t& getJreMaxMemory() const;
124 
128  const int64_t& getJreTotalMemory() const;
129 
133  const Types::Trytes& getLatestMilestone() const;
134 
138  const int64_t& getLatestMilestoneIndex() const;
139 
145  const Types::Trytes& getLatestSolidSubtangleMilestone() const;
146 
150  const int64_t& getLatestSolidSubtangleMilestoneIndex() const;
151 
155  const int64_t& getNeighbors() const;
156 
160  const int64_t& getPacketsQueueSize() const;
161 
165  const int64_t& getTime() const;
166 
170  const int64_t& getTips() const;
171 
175  const int64_t& getTransactionsToRequest() const;
176 
177 private:
182  std::string appName_;
186  std::string appVersion_;
190  int64_t jreAvailableProcessors_;
194  int64_t jreFreeMemory_;
198  int64_t jreMaxMemory_;
202  int64_t jreTotalMemory_;
206  Types::Trytes latestMilestone_;
210  int64_t latestMilestoneIndex_;
216  Types::Trytes latestSolidSubtangleMilestone_;
220  int64_t latestSolidSubtangleMilestoneIndex_;
224  int64_t neighbors_;
228  int64_t packetsQueueSize_;
232  int64_t time_;
236  int64_t tips_;
240  int64_t transactionsToRequest_;
241 };
242 
243 } // namespace Responses
244 
245 } // namespace API
246 
247 } // namespace IOTA
const int64_t & getLatestMilestoneIndex() const
Definition: get_node_info.hpp:44
const int64_t & getJreFreeMemory() const
const int64_t & getPacketsQueueSize() const
const Types::Trytes & getLatestSolidSubtangleMilestone() const
const int64_t & getTransactionsToRequest() const
const std::string & getAppVersion() const
const std::string & getAppName() const
const int64_t & getTime() const
const int64_t & getNeighbors() const
const int64_t & getLatestSolidSubtangleMilestoneIndex() const
void deserialize(const json &res) override
const int64_t & getTips() const
const int64_t & getJreMaxMemory() const
Definition: base.hpp:43
const Types::Trytes & getLatestMilestone() const
const int64_t & getJreAvailableProcessors() const
const int64_t & getJreTotalMemory() const
GetNodeInfo(const std::string &appName="", const std::string &appVersion="", int64_t jreAvailableProcessors=0, int64_t jreFreeMemory=0, int64_t jreMaxMemory=0, int64_t jreTotalMemory=0, const Types::Trytes &latestMilestone="", int64_t latestMilestoneIndex=0, const Types::Trytes &latestSolidSubtangleMilestone="", int64_t latestSolidSubtangleMilestoneIndex=0, int64_t neighbors=0, int64_t packetsQueueSize=0, int64_t time=0, int64_t tips=0, int64_t transactionsToRequest=0)
Definition: core.hpp:33