20#ifndef RIPPLE_PROTOCOL_STEXCHANGE_H_INCLUDED
21#define RIPPLE_PROTOCOL_STEXCHANGE_H_INCLUDED
23#include <xrpl/basics/Blob.h>
24#include <xrpl/basics/Buffer.h>
25#include <xrpl/basics/Slice.h>
26#include <xrpl/basics/contract.h>
27#include <xrpl/protocol/SField.h>
28#include <xrpl/protocol/STBlob.h>
29#include <xrpl/protocol/STInteger.h>
30#include <xrpl/protocol/STObject.h>
41template <
class U,
class T>
44template <
class U,
class T>
114template <
class T,
class U>
123 if (
id == STI_NOTPRESENT)
125 auto const u =
dynamic_cast<U const*
>(b);
128 Throw<std::runtime_error>(
"Wrong field type");
137 return get<typename U::value_type>(st, f);
142template <
class U,
class T>
159template <
class =
void>
Like std::vector<char> but better.
std::size_t size() const noexcept
Returns the number of bytes in the buffer.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
A type which can be exported to a well known binary format.
virtual SerializedTypeID getSType() const
std::uint8_t const * data() const
value_type value() const noexcept
STBase const * peekAtPField(SField const &field) const
void makeFieldAbsent(SField const &field)
void set(SOTemplate const &)
An immutable linear range of bytes.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
std::size_t size() const noexcept
Returns the number of bytes in the storage.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool set(T &target, std::string const &name, Section const §ion)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
void erase(STObject &st, TypedField< U > const &f)
Remove a field in an STObject.
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
static std::unique_ptr< STBlob > set(TypedField< STBlob > const &f, Buffer const &t)
static std::unique_ptr< STBlob > set(TypedField< STBlob > const &f, Buffer &&t)
static void get(std::optional< Buffer > &t, STBlob const &u)
static void get(std::optional< value_type > &t, STBlob const &u)
static std::unique_ptr< STBlob > set(TypedField< STBlob > const &f, Slice const &t)
static void get(std::optional< T > &t, STInteger< U > const &u)
static std::unique_ptr< STInteger< U > > set(SField const &f, T const &t)
Convert between serialized type U and C++ type T.
A field with a type known at compile time.