hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
query_client.hpp
Go to the documentation of this file.
1 
6 #ifndef TORII_UTILS_QUERY_CLIENT_HPP
7 #define TORII_UTILS_QUERY_CLIENT_HPP
8 
9 #include <endpoint.grpc.pb.h>
10 #include <endpoint.pb.h>
11 #include <grpc++/channel.h>
12 #include <grpc++/grpc++.h>
13 #include <memory>
14 #include <thread>
15 
16 namespace torii_utils {
17 
22  public:
23  QuerySyncClient(const std::string &ip, size_t port);
24 
27 
28  QuerySyncClient(QuerySyncClient &&) noexcept;
30 
37  grpc::Status Find(const iroha::protocol::Query &query,
38  iroha::protocol::QueryResponse &response) const;
39 
40  std::vector<iroha::protocol::BlockQueryResponse> FetchCommits(
41  const iroha::protocol::BlocksQuery &blocks_query) const;
42 
43  private:
44  void swap(QuerySyncClient &lhs, QuerySyncClient &rhs);
45 
46  std::string ip_;
47  size_t port_;
48  std::unique_ptr<iroha::protocol::QueryService_v1::Stub> stub_;
49  };
59 } // namespace torii_utils
60 
61 #endif // TORII_UTILS_QUERY_CLIENT_HPP
Definition: query_client.hpp:21
Definition: query_client.cpp:10
std::vector< iroha::protocol::BlockQueryResponse > FetchCommits(const iroha::protocol::BlocksQuery &blocks_query) const
Definition: query_client.cpp:51
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
QuerySyncClient(const std::string &ip, size_t port)
Definition: query_client.cpp:15
grpc::Status Find(const iroha::protocol::Query &query, iroha::protocol::QueryResponse &response) const
Definition: query_client.cpp:44
QuerySyncClient & operator=(QuerySyncClient)
Definition: query_client.cpp:24