diff options
Diffstat (limited to 'core/optimizer.hpp')
-rw-r--r-- | core/optimizer.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/core/optimizer.hpp b/core/optimizer.hpp index 10cfce9..6380d66 100644 --- a/core/optimizer.hpp +++ b/core/optimizer.hpp @@ -12,6 +12,7 @@ #include "opt_exception.hpp" #include <cstdlib> #include <functional> +#include <typeinfo> #ifdef DEBUG #include <iostream> using namespace std; @@ -59,6 +60,15 @@ namespace opt_utilities delete this; } + /** + \return the type name of self + */ + + virtual const char* do_get_type_name()const + { + return typeid(*this).name(); + } + public: /** Interface function to perform the clone @@ -77,6 +87,10 @@ namespace opt_utilities do_destroy(); } + const char* get_type_name()const + { + return this->do_get_type_name(); + } /** Makes the class object like a real function. @@ -175,6 +189,15 @@ namespace opt_utilities { delete this; } + + /** + \return the type name of self + */ + + virtual const char* do_get_type_name()const + { + return typeid(*this).name(); + } public: /** Interface function for seting optimizer @@ -287,6 +310,15 @@ namespace opt_utilities } /** + \return the type name of self + */ + + virtual const char* get_type_name()const + { + return this->do_get_type_name(); + } + + /** deconstruct function */ virtual ~opt_method(){}; |