20#ifndef RIPPLE_PROTOCOL_KNOWNFORMATS_H_INCLUDED
21#define RIPPLE_PROTOCOL_KNOWNFORMATS_H_INCLUDED
23#include <xrpl/basics/contract.h>
24#include <xrpl/beast/type_name.h>
25#include <xrpl/protocol/SOTemplate.h>
27#include <boost/container/flat_map.hpp>
41template <
class KeyType,
class Derived>
61 "KnownFormats KeyType must be integral or enum.");
120 return result->getType();
121 Throw<std::runtime_error>(
122 name_ +
": Unknown format name '" +
131 auto const itr =
types_.find(type);
156 auto const itr =
names_.find(name);
181 "': already maps to " + item->getName());
184 formats_.emplace_front(name, type, uniqueFields, commonFields);
201 boost::container::flat_map<std::string, Item const*>
names_;
202 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.