hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
utility_service.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_UTILITY_SERVICE_HPP
7 #define IROHA_UTILITY_SERVICE_HPP
8 
9 #include "logger/logger_fwd.hpp"
10 #include "status_notifier.hpp"
11 #include "utility_endpoint.grpc.pb.h"
12 #include "utility_endpoint.pb.h"
13 
14 namespace iroha {
15  namespace utility_service {
16 
17  class UtilityService : public proto::UtilityService_v1::Service,
18  public StatusNotifier {
19  public:
20  using ShutdownCallback = void (*)();
21 
22  UtilityService(ShutdownCallback shutdown_callback, logger::LoggerPtr log);
23 
25 
27  ::grpc::ServerContext *context,
28  const ::google::protobuf::Empty * /* request */,
29  ::grpc::ServerWriter<::iroha::utility_service::proto::Status> *writer)
30  override;
31 
33  ::grpc::ServerContext *context,
34  const ::google::protobuf::Empty * /* request */,
35  ::google::protobuf::Empty * /* response */) override;
36 
37  void notify(enum Status status) override;
38 
39  private:
40  struct Impl;
41  std::unique_ptr<Impl> impl_;
42 
43  const ShutdownCallback shutdown_callback_;
44  logger::LoggerPtr log_;
45  };
46 
47  } // namespace utility_service
48 } // namespace iroha
49 
50 #endif // IROHA_UTILITY_SERVICE_HPP
void notify(enum Status status) override
Definition: utility_service.cpp:39
void(*)() ShutdownCallback
Definition: utility_service.hpp:20
::grpc::Status Status(::grpc::ServerContext *context, const ::google::protobuf::Empty *, ::grpc::ServerWriter<::iroha::utility_service::proto::Status > *writer) override
Definition: utility_service.cpp:52
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
UtilityService(ShutdownCallback shutdown_callback, logger::LoggerPtr log)
Definition: utility_service.cpp:31
Definition: block_query.hpp:15
std::shared_ptr< iroha::utility_service::UtilityService > utility_service
Definition: irohad.cpp:117
Definition: utility_service.hpp:17
Definition: status_notifier.hpp:14
::grpc::Status Shutdown(::grpc::ServerContext *context, const ::google::protobuf::Empty *, ::google::protobuf::Empty *) override
Definition: utility_service.cpp:43
Status
Definition: status.hpp:12
Definition: utility_service.cpp:25