20 #ifndef RIPPLE_PROTOCOL_STBASE_H_INCLUDED
21 #define RIPPLE_PROTOCOL_STBASE_H_INCLUDED
23 #include <ripple/basics/contract.h>
24 #include <ripple/protocol/SField.h>
25 #include <ripple/protocol/Serializer.h>
43 include_date = 0b0000'0001,
46 // IMPORTANT `_all` must be union of all of the above; see also operator~
55 [[nodiscard]] constexpr
explicit operator underlying_t() const noexcept
59 [[nodiscard]] constexpr
explicit operator bool() const noexcept
63 [[nodiscard]] constexpr
auto friend
65 [[nodiscard]] constexpr
auto friend
72 return {lh.
value | rh.value};
79 return {lh.
value & rh.value};
202 D* ptr =
dynamic_cast<D*
>(
this);
204 Throw<std::bad_cast>();
212 D
const* ptr =
dynamic_cast<D const*
>(
this);
214 Throw<std::bad_cast>();
224 return new U(std::forward<T>(val));
225 return new (buf) U(std::forward<T>(val));
STBase & operator=(const STBase &t)
virtual SerializedTypeID getSType() const
virtual bool isEquivalent(STBase const &t) const
virtual void add(Serializer &s) const
virtual STBase * copy(std::size_t n, void *buf) const
void addFieldID(Serializer &s) const
constexpr JsonOptions friend operator&(JsonOptions lh, JsonOptions rh) noexcept
Returns JsonOptions intersection of lh and rh.
std::ostream & operator<<(std::ostream &os, TOffer< TIn, TOut > const &offer)
constexpr auto friend operator==(JsonOptions lh, JsonOptions rh) noexcept -> bool=default
virtual bool isDefault() const
unsigned int underlying_t
static STBase * emplace(std::size_t n, void *buf, T &&val)
void setFName(SField const &n)
A STBase is a field.
virtual std::string getText() const
virtual std::string getFullText() const
SField const & getFName() const
constexpr JsonOptions friend operator~(JsonOptions v) noexcept
Returns JsonOptions binary negation, can be used with & (above) for set difference e....
constexpr JsonOptions(underlying_t v) noexcept
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Note, should be treated as flags that can be | and &.
virtual ~STBase()=default
A type which can be exported to a well known binary format.
bool operator!=(const STBase &t) const
bool operator==(const STBase &t) const
virtual STBase * move(std::size_t n, void *buf)
constexpr auto friend operator!=(JsonOptions lh, JsonOptions rh) noexcept -> bool=default
constexpr JsonOptions friend operator|(JsonOptions lh, JsonOptions rh) noexcept
Returns JsonOptions union of lh and rh.
virtual Json::Value getJson(JsonOptions) const