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;
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.
A proxy type for name lookups in a Schema.
bool operator==(AliasMap const &other) const
Equality comparison.
AliasMap(AliasMap const &other)
Deep-copy an AliasMap.
void set(std::string const &alias, std::string const &target)
Add an alias to the schema or replace an existing one.
Mapping class that holds aliases for a Schema.
Iterator begin() const
Return a iterator to the beginning of the map.
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.
table::Key< std::string > name
bool erase(std::string const &alias)
Remove an alias from the schema if it is present.
bool empty() const
Return the true if there are no aliases.
Iterator end() const
Return a iterator to one past the end of the map.
std::size_t size() const
Return the number of aliases.
std::map< std::string, std::string >::const_iterator Iterator
An iterator over alias->target pairs.
Base class for all tables.
bool contains(AliasMap const &other) const
Return true if all aliases in this are also in other (with the same targets).