hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
proto_ordering.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_PROTO_MODEL_QUERY_ORDERING_HPP
7 #define IROHA_SHARED_PROTO_MODEL_QUERY_ORDERING_HPP
8 
10 
12 #include "queries.pb.h"
13 
14 namespace shared_model {
15  namespace proto {
16 
18  class OrderingImpl final : public interface::Ordering {
19  public:
20  OrderingImpl &operator=(OrderingImpl const &) = delete;
21 
22  OrderingImpl();
23  OrderingImpl(iroha::protocol::Ordering const &proto_ordering);
25  OrderingImpl(OrderingImpl const &);
26 
27  bool append(ModelType::Field field,
28  ModelType::Direction direction) override;
29  void reset() override;
30  void get(ModelType::OrderingEntry const *&orderingEntry,
31  size_t &count) const override;
32 
33  private:
34  size_t count_;
35  bool inserted_[(size_t)ModelType::Field::kMaxValueCount];
36  ModelType::OrderingEntry
37  ordering_[(size_t)ModelType::Field::kMaxValueCount];
38 
39  inline void copy(OrderingImpl const &src);
40  inline void appendUnsafe(ModelType::Field field,
41  ModelType::Direction direction);
42  };
43 
44  } // namespace proto
45 } // namespace shared_model
46 
47 #endif // IROHA_SHARED_PROTO_MODEL_QUERY_ORDERING_HPP
Definition: ordering.hpp:19
bool append(ModelType::Field field, ModelType::Direction direction) override
Definition: proto_ordering.cpp:99
void reset() override
Definition: proto_ordering.cpp:116
Field
Definition: ordering.hpp:24
Provides ordering data for pagination.
Definition: proto_ordering.hpp:18
Definition: command_executor.hpp:12
OrderingImpl()
Definition: proto_ordering.cpp:47
Direction
Definition: ordering.hpp:35
OrderingImpl & operator=(OrderingImpl const &)=delete