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>
26#include <boost/container/flat_map.hpp>
39template <
class KeyType,
class Derived>
59 "KnownFormats KeyType must be integral or enum.");
118 return result->getType();
119 Throw<std::runtime_error>(
120 name_ +
": Unknown format name '" +
129 auto const itr =
types_.find(type);
154 auto const itr =
names_.find(name);
179 "': already maps to " + item->getName());
182 formats_.emplace_front(name, type, uniqueFields, commonFields);
199 boost::container::flat_map<std::string, Item const*>
names_;
200 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.