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.");
101 return result->getType();
102 Throw<std::runtime_error>(
103 name_ +
": Unknown format name '" +
112 auto const itr =
types_.find(type);
137 auto const itr =
names_.find(name);
161 std::string(
"Duplicate key for item '") + name +
"': already maps to " +
165 formats_.emplace_front(name, type, std::move(uniqueFields), std::move(commonFields));
182 boost::container::flat_map<std::string, Item const*>
names_;
183 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.