Ethereum  PoC-8
The C++ Implementation of Ethereum
dev::NibbleSlice Struct Reference

#include <TrieCommon.h>

Public Member Functions

 NibbleSlice (bytesConstRef _data=bytesConstRef(), unsigned _offset=0)
 
byte operator[] (unsigned _index) const
 
unsigned size () const
 
bool empty () const
 
NibbleSlice mid (unsigned _index) const
 
void clear ()
 
bool contains (NibbleSlice _k) const
 
unsigned shared (NibbleSlice _k) const
 
bool isEarlierThan (NibbleSlice _k) const
 Determine if we, a full key, are situated prior to a particular key-prefix. More...
 
bool operator== (NibbleSlice _k) const
 
bool operator!= (NibbleSlice _s) const
 

Public Attributes

bytesConstRef data
 
unsigned offset
 

Detailed Description

Nibble-based view on a bytesConstRef.

Definition at line 53 of file TrieCommon.h.

Constructor & Destructor Documentation

◆ NibbleSlice()

dev::NibbleSlice::NibbleSlice ( bytesConstRef  _data = bytesConstRef(),
unsigned  _offset = 0 
)
inline

Definition at line 58 of file TrieCommon.h.

Member Function Documentation

◆ clear()

void dev::NibbleSlice::clear ( )
inline

Definition at line 63 of file TrieCommon.h.

◆ contains()

bool dev::NibbleSlice::contains ( NibbleSlice  _k) const
inline
Returns
true iff _k is a prefix of this.

Definition at line 66 of file TrieCommon.h.

◆ empty()

bool dev::NibbleSlice::empty ( ) const
inline

Definition at line 61 of file TrieCommon.h.

◆ isEarlierThan()

bool dev::NibbleSlice::isEarlierThan ( NibbleSlice  _k) const
inline

Determine if we, a full key, are situated prior to a particular key-prefix.

Parameters
_kThe prefix.
Returns
true if we are strictly prior to the prefix.

Definition at line 74 of file TrieCommon.h.

◆ mid()

NibbleSlice dev::NibbleSlice::mid ( unsigned  _index) const
inline

Definition at line 62 of file TrieCommon.h.

◆ operator!=()

bool dev::NibbleSlice::operator!= ( NibbleSlice  _s) const
inline

Definition at line 87 of file TrieCommon.h.

◆ operator==()

bool dev::NibbleSlice::operator== ( NibbleSlice  _k) const
inline

Definition at line 86 of file TrieCommon.h.

◆ operator[]()

byte dev::NibbleSlice::operator[] ( unsigned  _index) const
inline

Definition at line 59 of file TrieCommon.h.

◆ shared()

unsigned dev::NibbleSlice::shared ( NibbleSlice  _k) const
inline
Returns
the number of shared nibbles at the beginning of this and _k.

Definition at line 68 of file TrieCommon.h.

◆ size()

unsigned dev::NibbleSlice::size ( ) const
inline

Definition at line 60 of file TrieCommon.h.

Member Data Documentation

◆ data

bytesConstRef dev::NibbleSlice::data

Definition at line 55 of file TrieCommon.h.

◆ offset

unsigned dev::NibbleSlice::offset

Definition at line 56 of file TrieCommon.h.


The documentation for this struct was generated from the following file: