hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
postgres_query_executor.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_POSTGRES_QUERY_EXECUTOR_HPP
7 #define IROHA_POSTGRES_QUERY_EXECUTOR_HPP
8 
10 
11 #include <soci/soci.h>
12 #include "logger/logger_fwd.hpp"
13 
14 namespace shared_model {
15  namespace interface {
16  class QueryResponseFactory;
17  } // namespace interface
18 } // namespace shared_model
19 
20 namespace iroha {
21  namespace ametsuchi {
22 
23  class SpecificQueryExecutor;
24 
26  public:
28  std::unique_ptr<soci::session> sql,
29  std::shared_ptr<shared_model::interface::QueryResponseFactory>
30  response_factory,
31  std::shared_ptr<SpecificQueryExecutor> specific_query_executor,
32  logger::LoggerPtr log);
33 
34  QueryExecutorResult validateAndExecute(
35  const shared_model::interface::Query &query,
36  const bool validate_signatories) override;
37 
38  bool validate(const shared_model::interface::BlocksQuery &query,
39  const bool validate_signatories) override;
40 
41  private:
42  template <class Q>
43  bool validateSignatures(const Q &query);
44 
45  std::unique_ptr<soci::session> sql_;
46  std::shared_ptr<SpecificQueryExecutor> specific_query_executor_;
47  std::shared_ptr<shared_model::interface::QueryResponseFactory>
48  query_response_factory_;
49  logger::LoggerPtr log_;
50  };
51 
52  } // namespace ametsuchi
53 } // namespace iroha
54 
55 #endif // IROHA_POSTGRES_QUERY_EXECUTOR_HPP
Definition: query.hpp:35
Definition: blocks_query.hpp:20
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
std::unique_ptr< shared_model::interface::QueryResponse > QueryExecutorResult
Definition: query_executor.hpp:23
Definition: block_query.hpp:14
Definition: query_executor.hpp:25
Definition: command_executor.hpp:12
Definition: postgres_query_executor.hpp:25