1#ifndef XRPL_PROTOCOL_KNOWNFORMATS_H_INCLUDED
2#define XRPL_PROTOCOL_KNOWNFORMATS_H_INCLUDED
4#include <xrpl/basics/contract.h>
5#include <xrpl/beast/type_name.h>
6#include <xrpl/protocol/SOTemplate.h>
8#include <boost/container/flat_map.hpp>
22template <
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);
162 "': already maps to " + item->getName());
165 formats_.emplace_front(name, type, uniqueFields, 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.