hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
ordering.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_ORDERING_HPP
7 #define IROHA_SHARED_MODEL_ORDERING_HPP
8 
11 
12 namespace shared_model {
13  namespace interface {
14 
19  class Ordering : public ModelPrimitive<Ordering> {
20  public:
24  enum struct Field : size_t {
25  kCreatedTime = 0,
26  kPosition,
27  //--------------
29  kUnknownValue = kMaxValueCount
30  };
31 
35  enum struct Direction : size_t {
36  kAscending = 0,
37  kDescending,
38  //--------------
40  kUnknownValue = kMaxValueCount
41  };
42 
46  struct OrderingEntry {
49  };
50 
56  virtual bool append(Field field, Direction direction) = 0;
57 
61  virtual void reset() = 0;
62 
69  virtual void get(OrderingEntry const *&orderingEntry,
70  size_t &count) const = 0;
71 
72  std::string toString() const override;
73  bool operator==(const ModelType &rhs) const override;
74  };
75 
76  } // namespace interface
77 } // namespace shared_model
78 
79 #endif // IROHA_SHARED_MODEL_ORDERING_HPP
Definition: ordering.hpp:19
Direction direction
Definition: ordering.hpp:48
virtual bool append(Field field, Direction direction)=0
Field field
Definition: ordering.hpp:47
Field
Definition: ordering.hpp:24
bool operator==(const ModelType &rhs) const override
Definition: ordering.cpp:38
std::string toString() const override
Definition: ordering.cpp:51
Definition: model_primitive.hpp:22
Definition: command_executor.hpp:12
Direction
Definition: ordering.hpp:35