3#include <xrpl/basics/contract.h>
4#include <xrpl/beast/type_name.h>
5#include <xrpl/protocol/SOTemplate.h>
7#include <boost/container/flat_map.hpp>
21template <
class KeyType,
class Derived>
42 "KnownFormats KeyType must be integral or enum.");
103 return result->getType();
105 name_ +
": Unknown format name '" +
111 [[nodiscard]] Item
const*
114 auto const itr =
types_.find(type);
121 [[nodiscard]] std::forward_list<Item>::const_iterator
127 [[nodiscard]] std::forward_list<Item>::const_iterator
136 [[nodiscard]] Item
const*
139 auto const itr =
names_.find(name);
163 std::string(
"Duplicate key for item '") + name +
"': already maps to " +
167 formats_.emplace_front(name, type, std::move(uniqueFields), std::move(commonFields));
184 boost::container::flat_map<std::string, Item const*>
names_{};
185 boost::container::flat_map<KeyType, Item const*>
types_{};
Defines the fields and their attributes within a STObject.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void logicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)