X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/b78d5563826957045678f4c3bcfdcef6c9bfc48d..refs/heads/master:/named_object_list.h diff --git a/named_object_list.h b/named_object_list.h index 929a0db..7731a89 100644 --- a/named_object_list.h +++ b/named_object_list.h @@ -24,6 +24,7 @@ protected: std::string description; creator_base(const std::string& descr): description(descr) { } creator_base(const char* descr): description(descr) { } + virtual ~creator_base() { } virtual Base* operator()() const = 0; }; @@ -64,12 +65,7 @@ public: if (it != assoc.end()) return (*it->second)(); else - return NULL; - } - - Base* new_instance(const char* name) const - { - return new_instance(std::string(name)); + return nullptr; } const std::string& get_name(iterator& it) const { return it->first; } @@ -92,6 +88,7 @@ protected: std::string description; creator_base(const std::string& descr): description(descr) { } creator_base(const char* descr): description(descr) { } + virtual ~creator_base() { } virtual Base* operator()(Arg1, Arg2) const = 0; }; @@ -133,12 +130,7 @@ public: if (it != assoc.end()) return (*it->second)(arg1, arg2); else - return NULL; - } - - Base* new_instance(const char* name, Arg1 arg1, Arg2 arg2) const - { - return new_instance(std::string(name), arg1, arg2); + return nullptr; } const std::string& get_name(iterator& it) const { return it->first; }