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()) {
103 for (
auto entry : _internal) {
std::string get(std::string const &alias) const
Return the target of the given alias.
bool contains(AliasMap const &other) const
Return true if all aliases in this are also in other (with the same targets).
std::size_t hash_value() const noexcept
Return a hash of this object.
Iterator end() const
Return a iterator to one past the end of the map.
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.
Reports attempts to access elements using an invalid key.
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.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
bool operator==(AliasMap const &other) const
Equality comparison.
bool erase(std::string const &alias)
Remove an alias from the schema if it is present.
Key< Flag > const & target
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Iterator begin() const
Return a iterator to the beginning of the map.
ItemVariant const * other
std::size_t hashCombine(std::size_t seed) noexcept
Combine hashes.
std::map< std::string, std::string >::const_iterator Iterator
An iterator over alias->target pairs.
virtual void handleAliasChange(std::string const &alias)