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>
26template <
class KeyType,
class Derived>
48 "KnownFormats KeyType must be integral or enum.");
114 return result->getType();
116 name_ +
": Unknown format name '" +
123 [[nodiscard]] Item
const*
126 auto const itr =
types_.find(type);
133 [[nodiscard]] std::forward_list<Item>::const_iterator
139 [[nodiscard]] std::forward_list<Item>::const_iterator
149 [[nodiscard]] Item
const*
152 auto const itr =
names_.find(name);
177 std::string(
"Duplicate key for item '") + name +
"': already maps to " +
181 formats_.emplace_front(name, type, std::move(uniqueFields), std::move(commonFields));
198 boost::container::flat_map<std::string, Item const*>
names_{};
199 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)