hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
utility_client.hpp
Go to the documentation of this file.
1 
6 #ifndef UTILITY_CLIENT_HPP
7 #define UTILITY_CLIENT_HPP
8 
9 #include <chrono>
10 #include <string>
11 
12 #include <logger/logger_fwd.hpp>
13 #include "util/status.hpp"
14 
15 namespace iroha {
16  namespace utility_service {
17 
18  class UtilityClient {
19  public:
20  UtilityClient(std::string const &irohad_address, logger::LoggerPtr log);
21 
23 
24  bool waitForServerReady(std::chrono::milliseconds timeout) const;
25 
30  using StatusCallback = bool (*)(const Status &);
31 
32  bool status(StatusCallback callback) const;
33 
34  bool shutdown() const;
35 
36  private:
37  struct StubHolder;
38 
39  logger::LoggerPtr log_;
40  std::unique_ptr<StubHolder> stub_holder_;
41  };
42 
43  } // namespace utility_service
44 } // namespace iroha
45 
46 #endif /* UTILITY_CLIENT_HPP */
UtilityClient(std::string const &irohad_address, logger::LoggerPtr log)
Definition: utility_client.cpp:36
bool shutdown() const
Definition: utility_client.cpp:79
Definition: utility_client.hpp:18
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: block_query.hpp:15
std::shared_ptr< iroha::utility_service::UtilityService > utility_service
Definition: irohad.cpp:121
bool(*)(const Status &) StatusCallback
Definition: utility_client.hpp:30
Definition: timeout.hpp:28
bool waitForServerReady(std::chrono::milliseconds timeout) const
Definition: utility_client.cpp:43
bool status(StatusCallback callback) const
Definition: utility_client.cpp:61
Status
Definition: status.hpp:12
Definition: utility_client.cpp:23