Skip to content

Commit

Permalink
add names for basic types
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianPommerening committed Jul 25, 2024
1 parent 261b03e commit d2d51c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/search/plugins/types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,16 @@ EmptyListType TypeRegistry::EMPTY_LIST_TYPE;
BasicType TypeRegistry::NO_TYPE = BasicType(typeid(void), "<no type>");

TypeRegistry::TypeRegistry() {
insert_basic_type<bool>();
insert_basic_type<string>();
insert_basic_type<int>();
insert_basic_type<double>();
insert_basic_type<bool>("bool");
insert_basic_type<string>("string");
insert_basic_type<int>("int");
insert_basic_type<double>("double");
}

template<typename T>
void TypeRegistry::insert_basic_type() {
void TypeRegistry::insert_basic_type(const string &name) {
type_index type = typeid(T);
registered_types[type] = utils::make_unique_ptr<BasicType>(type, utils::get_type_name<T>());
registered_types[type] = utils::make_unique_ptr<BasicType>(type, name);
}

const FeatureType &TypeRegistry::create_feature_type(const CategoryPlugin &plugin) {
Expand Down
2 changes: 1 addition & 1 deletion src/search/plugins/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class TypeRegistry {
std::unordered_map<const Type *, std::unique_ptr<ListType>,
SemanticHash, SemanticEqual> registered_list_types;
template<typename T>
void insert_basic_type();
void insert_basic_type(const std::string &name);
const Type &get_nonlist_type(std::type_index type) const;
public:
static BasicType NO_TYPE;
Expand Down

0 comments on commit d2d51c8

Please sign in to comment.