20 #ifndef RIPPLE_PROTOCOL_KNOWNFORMATS_H_INCLUDED
21 #define RIPPLE_PROTOCOL_KNOWNFORMATS_H_INCLUDED
23 #include <ripple/basics/contract.h>
24 #include <ripple/protocol/SOTemplate.h>
25 #include <boost/container/flat_map.hpp>
38 template <
class KeyType>
59 "KnownFormats KeyType must be integral or enum.");
112 if (result !=
nullptr)
113 return result->getType ();
114 Throw<std::runtime_error> (
"Unknown format name");
122 auto const itr =
types_.find (type);
133 auto const itr =
names_.find (name);
152 formats_.emplace_front (name, type, uniqueFields, commonFields);
153 Item
const& item {
formats_.front()};
167 boost::container::flat_map<std::string, Item const*>
names_;
168 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.