|
rippled
|
A type that represents either a sequence value or a ticket value. More...
#include <SeqProxy.h>

Public Types | |
| enum | Type : std::uint8_t { seq = 0 , ticket } |
Public Member Functions | |
| constexpr | SeqProxy (Type t, std::uint32_t v) |
| SeqProxy (SeqProxy const &other)=default | |
| SeqProxy & | operator= (SeqProxy const &other)=default |
| constexpr std::uint32_t | value () const |
| constexpr bool | isSeq () const |
| constexpr bool | isTicket () const |
| SeqProxy & | advanceBy (std::uint32_t amount) |
Static Public Member Functions | |
| static constexpr SeqProxy | sequence (std::uint32_t v) |
| Factory function to return a sequence-based SeqProxy. | |
Private Attributes | |
| std::uint32_t | value_ |
| Type | type_ |
Friends | |
| constexpr bool | operator== (SeqProxy lhs, SeqProxy rhs) |
| constexpr bool | operator!= (SeqProxy lhs, SeqProxy rhs) |
| constexpr bool | operator< (SeqProxy lhs, SeqProxy rhs) |
| constexpr bool | operator> (SeqProxy lhs, SeqProxy rhs) |
| constexpr bool | operator>= (SeqProxy lhs, SeqProxy rhs) |
| constexpr bool | operator<= (SeqProxy lhs, SeqProxy rhs) |
| std::ostream & | operator<< (std::ostream &os, SeqProxy seqProx) |
A type that represents either a sequence value or a ticket value.
We use the value() of a SeqProxy in places where a sequence was used before. An example of this is the sequence of an Offer stored in the ledger. We do the same thing with the in-ledger identifier of a Check, Payment Channel, and Escrow.
Why is this safe? If we use the SeqProxy::value(), how do we know that each ledger entry will be unique?
There are two components that make this safe:
When a "TicketCreate" transaction creates a batch of tickets it advances the account root sequence to one past the largest created ticket.
Therefore all tickets in a batch other than the first may never have the same value as a sequence on that same account. And since a ticket may only be used once there will never be any duplicates within this account.
Definition at line 36 of file SeqProxy.h.
| Enumerator | |
|---|---|
| seq | |
| ticket | |
Definition at line 39 of file SeqProxy.h.
|
explicitconstexpr |
Definition at line 46 of file SeqProxy.h.
|
default |
|
staticconstexpr |
Factory function to return a sequence-based SeqProxy.
Definition at line 57 of file SeqProxy.h.
|
constexpr |
Definition at line 63 of file SeqProxy.h.
|
constexpr |
Definition at line 69 of file SeqProxy.h.
|
constexpr |
Definition at line 75 of file SeqProxy.h.
| SeqProxy & ripple::SeqProxy::advanceBy | ( | std::uint32_t | amount | ) |
Definition at line 85 of file SeqProxy.h.
Definition at line 102 of file SeqProxy.h.
Definition at line 110 of file SeqProxy.h.
Definition at line 115 of file SeqProxy.h.
Definition at line 124 of file SeqProxy.h.
Definition at line 130 of file SeqProxy.h.
Definition at line 135 of file SeqProxy.h.
|
friend |
Definition at line 141 of file SeqProxy.h.
|
private |
Definition at line 42 of file SeqProxy.h.
|
private |
Definition at line 43 of file SeqProxy.h.