rippled
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ripple::cryptoconditions::Condition Class Reference
Collaboration diagram for ripple::cryptoconditions::Condition:
Collaboration graph
[legend]

Public Member Functions

 Condition (Type t, std::uint32_t c, Slice fp)
 
 Condition (Type t, std::uint32_t c, Buffer &&fp)
 
 ~Condition ()=default
 
 Condition (Condition const &)=default
 
 Condition (Condition &&)=default
 
 Condition ()=delete
 

Static Public Member Functions

static std::unique_ptr< Conditiondeserialize (Slice s, std::error_code &ec)
 Load a condition from its binary form. More...
 

Public Attributes

Type type
 
Buffer fingerprint
 An identifier for this condition. More...
 
std::uint32_t cost
 The cost associated with this condition. More...
 
std::set< Typesubtypes
 For compound conditions, set of conditions includes. More...
 

Static Public Attributes

static constexpr std::size_t maxSerializedCondition = 128
 The largest binary condition we support. More...
 

Detailed Description

Definition at line 44 of file Condition.h.

Constructor & Destructor Documentation

◆ Condition() [1/5]

ripple::cryptoconditions::Condition::Condition ( Type  t,
std::uint32_t  c,
Slice  fp 
)

Definition at line 85 of file Condition.h.

◆ Condition() [2/5]

ripple::cryptoconditions::Condition::Condition ( Type  t,
std::uint32_t  c,
Buffer &&  fp 
)

Definition at line 90 of file Condition.h.

◆ ~Condition()

ripple::cryptoconditions::Condition::~Condition ( )
default

◆ Condition() [3/5]

ripple::cryptoconditions::Condition::Condition ( Condition const &  )
default

◆ Condition() [4/5]

ripple::cryptoconditions::Condition::Condition ( Condition &&  )
default

◆ Condition() [5/5]

ripple::cryptoconditions::Condition::Condition ( )
delete

Member Function Documentation

◆ deserialize()

std::unique_ptr< Condition > ripple::cryptoconditions::Condition::deserialize ( Slice  s,
std::error_code ec 
)
static

Load a condition from its binary form.

Parameters
sThe buffer containing the fulfillment to load.
ecSet to the error, if any occurred.

The binary format for a condition is specified in the cryptoconditions RFC. See:

https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-7.2

Definition at line 152 of file Condition.cpp.

Member Data Documentation

◆ maxSerializedCondition

constexpr std::size_t ripple::cryptoconditions::Condition::maxSerializedCondition = 128
staticconstexpr

The largest binary condition we support.

Note
This value will be increased in the future, but it must never decrease, as that could cause conditions that were previously considered valid to no longer be allowed.

Definition at line 54 of file Condition.h.

◆ type

Type ripple::cryptoconditions::Condition::type

Definition at line 70 of file Condition.h.

◆ fingerprint

Buffer ripple::cryptoconditions::Condition::fingerprint

An identifier for this condition.

This fingerprint is meant to be unique only with respect to other conditions of the same type.

Definition at line 77 of file Condition.h.

◆ cost

std::uint32_t ripple::cryptoconditions::Condition::cost

The cost associated with this condition.

Definition at line 80 of file Condition.h.

◆ subtypes

std::set<Type> ripple::cryptoconditions::Condition::subtypes

For compound conditions, set of conditions includes.

Definition at line 83 of file Condition.h.