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>
40 "KnownFormats KeyType must be integral or enum.");
99 return result->getType();
100 Throw<std::runtime_error>(
109 auto const itr =
types_.find(type);
134 auto const itr =
names_.find(name);
157 LogicError(
std::string(
"Duplicate key for item '") + name +
"': already maps to " + item->getName());
160 formats_.emplace_front(name, type, uniqueFields, commonFields);
177 boost::container::flat_map<std::string, Item const*>
names_;
178 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.