hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::interface::Ordering Class Referenceabstract

#include "ordering.hpp"

Inheritance diagram for shared_model::interface::Ordering:
Inheritance graph
Collaboration diagram for shared_model::interface::Ordering:
Collaboration graph

Classes

struct  OrderingEntry
 

Public Types

enum  Field : size_t { Field::kCreatedTime = 0, Field::kPosition, Field::kMaxValueCount, Field::kUnknownValue = kMaxValueCount }
 
enum  Direction : size_t { Direction::kAscending = 0, Direction::kDescending, Direction::kMaxValueCount, Direction::kUnknownValue = kMaxValueCount }
 
- Public Types inherited from shared_model::interface::ModelPrimitive< Ordering >
using ModelType = Ordering
 

Public Member Functions

virtual bool append (Field field, Direction direction)=0
 
virtual void reset ()=0
 
virtual void get (OrderingEntry const *&orderingEntry, size_t &count) const =0
 
std::string toString () const override
 
bool operator== (const ModelType &rhs) const override
 
- Public Member Functions inherited from shared_model::interface::ModelPrimitive< Ordering >
virtual bool operator== (const ModelType &rhs) const=0
 
virtual bool operator!= (const ModelType &rhs) const
 
virtual ~ModelPrimitive ()=default
 

Detailed Description

Class Ordering provides description of data ordering in queries. General note: this is interface.

Member Enumeration Documentation

◆ Direction

Ordering direction for each field.

Enumerator
kAscending 
kDescending 
kMaxValueCount 
kUnknownValue 

◆ Field

Field name for ordering entry.

Enumerator
kCreatedTime 
kPosition 
kMaxValueCount 
kUnknownValue 

Member Function Documentation

◆ append()

virtual bool shared_model::interface::Ordering::append ( Field  field,
Direction  direction 
)
pure virtual

Append - stores field and direction entry uniquely. The insertion order determines the ordering priority.

Returns
the insertion result(true - inserted, false - skipped).

◆ get()

virtual void shared_model::interface::Ordering::get ( OrderingEntry const *&  orderingEntry,
size_t &  count 
) const
pure virtual

Get - returns data sorted in the insertion order. is a reference to a const OrderingEntry pointer, which positions to the first element is a number of OrderingEntry items

Here is the caller graph for this function:

◆ operator==()

bool Ordering::operator== ( const ModelType rhs) const
override

◆ reset()

virtual void shared_model::interface::Ordering::reset ( )
pure virtual

Reset - drops all saved data.

Implemented in shared_model::proto::OrderingImpl.

◆ toString()

std::string Ordering::toString ( ) const
overridevirtual

Make string developer representation of object

Returns
string with internal state of object

Reimplemented from shared_model::interface::ModelPrimitive< Ordering >.

Here is the call graph for this function:

The documentation for this class was generated from the following files: