2 #ifndef AFW_TABLE_AliasMap_h_INCLUDED 3 #define AFW_TABLE_AliasMap_h_INCLUDED 37 typedef std::map<std::string, std::string> Internal;
51 typedef std::map<std::string, std::string>::const_iterator
Iterator;
54 Iterator
begin()
const {
return _internal.begin(); }
57 Iterator
end()
const {
return _internal.end(); }
60 std::size_t
size()
const {
return _internal.size(); }
63 bool empty()
const {
return _internal.empty(); }
80 std::string
apply(std::string
const&
name)
const;
89 std::string
get(std::string
const& alias)
const;
92 void set(std::string
const& alias, std::string
const& target);
99 bool erase(std::string
const& alias);
118 void _apply(std::string& name)
const;
131 #endif // !AFW_TABLE_AliasMap_h_INCLUDED Defines the fields and offsets for a table.
bool contains(AliasMap const &other) const
Return true if all aliases in this are also in other (with the same targets).
A proxy type for name lookups in a Schema.
std::size_t size() const
Return the number of aliases.
Iterator end() const
Return a iterator to one past the end of the map.
AliasMap(AliasMap const &other)
Deep-copy an AliasMap.
Mapping class that holds aliases for a Schema.
A base class for image defects.
std::string apply(std::string const &name) const
Apply any aliases that match the given field name and return a de-aliased name.
bool operator!=(AliasMap const &other) const
Equality comparison.
bool operator==(AliasMap const &other) const
Equality comparison.
table::Key< std::string > name
bool erase(std::string const &alias)
Remove an alias from the schema if it is present.
Iterator begin() const
Return a iterator to the beginning of the map.
bool empty() const
Return the true if there are no aliases.
std::map< std::string, std::string >::const_iterator Iterator
An iterator over alias->target pairs.
Base class for all tables.