45 if (i != _internal.
end() && i->first.
size() ==
name.size() && i->first ==
name) {
48 }
else if (i != _internal.
begin()) {
54 if (i->first.size() <
name.size() &&
name.compare(0, i->first.size(), i->first) == 0) {
55 name.replace(0, i->first.size(), i->second);
64 (boost::format(
"Cycle detected in schema aliases involving name '%s'") %
name).str());
75 if (i == _internal.
end()) {
77 (boost::format(
"Alias '%s' not found") %
name).str());
90 bool result = _internal.
erase(alias);
103 for (
auto entry : _internal) {
table::Key< std::string > name
Key< Flag > const & target
#define LSST_EXCEPT(type,...)
Mapping class that holds aliases for a Schema.
bool contains(AliasMap const &other) const
Return true if all aliases in this are also in other (with the same targets).
std::map< std::string, std::string >::const_iterator Iterator
An iterator over alias->target pairs.
std::string apply(std::string const &name) const
Apply any aliases that match the given field name and return a de-aliased name.
Iterator begin() const
Return a iterator to the beginning of the map.
bool erase(std::string const &alias)
Remove an alias from the schema if it is present.
std::string get(std::string const &alias) const
Return the target of the given alias.
std::size_t hash_value() const noexcept
Return a hash of this object.
void set(std::string const &alias, std::string const &target)
Add an alias to the schema or replace an existing one.
bool operator==(AliasMap const &other) const
Equality comparison.
Iterator end() const
Return a iterator to one past the end of the map.
virtual void handleAliasChange(std::string const &alias)
std::size_t hashCombine(std::size_t seed) noexcept
A base class for image defects.