100 if (name.label() ==
"") {
return true; }
107 if (
_prm_->isType(name.label())) {
112 if (
_prm_->isInterface(name.label())) {
117 if (
_prm_->isClass(name.label())) {
123 if (t->name().label() == name.label()) {
130 if (i->name().label() == name.label()) {
137 if (c->name().label() == name.label()) {
143 auto lookup =
"." + name.label();
145 auto matches = std::vector< std::string >();
148 for (
auto t:
_prm_->types()) {
150 if (!found.exists(t->name())) {
152 matches.push_back(t->name());
158 if (
endsWith(t->name().label(), lookup)) {
159 if (!found.exists(t->name().label())) {
160 found.
insert(t->name().label());
161 matches.push_back(t->name().label());
167 for (
auto i:
_prm_->interfaces()) {
169 if (!found.exists(i->name())) {
171 matches.push_back(i->name());
177 if (
endsWith(i->name().label(), lookup)) {
178 if (!found.exists(i->name().label())) {
179 found.
insert(i->name().label());
180 matches.push_back(i->name().label());
186 for (
auto c:
_prm_->classes()) {
188 if (!found.exists(c->name())) {
190 matches.push_back(c->name());
196 if (
endsWith(c->name().label(), lookup)) {
197 if (!found.exists(c->name().label())) {
198 found.
insert(c->name().label());
199 matches.push_back(c->name().label());
204 if (matches.
size() == 1) {
206 name.label() = matches.back();
209 }
else if (matches.
size() == 0) {
212 O3PRM_TYPE_NOT_FOUND(name, *
_errors_);
218 O3PRM_TYPE_AMBIGUOUS(name, matches, *
_errors_);
ErrorsContainer * _errors_
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
bool endsWith(std::string const &value, std::string const &ending)
Returns true if value ends with ending.
O3InterfaceList & interfaces()
PRM< GUM_SCALAR > * _prm_
Size size() const noexcept
Returns the number of elements in the set.
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
void insert(const Key &k)
Inserts a new element into the set.