From 18b6a5d898e798d53478b13e2b0c997eed626760 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Fri, 11 Sep 2009 10:16:41 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@67 ed2142bd-67ad-457f-ba7c-d818d4011675 --- core/fitter.hpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ core/optimizer.hpp | 32 ++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/core/fitter.hpp b/core/fitter.hpp index dd33138..92738e5 100644 --- a/core/fitter.hpp +++ b/core/fitter.hpp @@ -232,7 +232,15 @@ namespace opt_utilities virtual void do_add_data(const data&)=0; virtual void do_clear()=0; virtual data_set* do_clone()const=0; + /** + \return the type name of self + */ + virtual const char* do_get_type_name()const + { + return typeid(*this).name(); + } + virtual void do_destroy() { delete this; @@ -283,6 +291,12 @@ namespace opt_utilities return this->do_clone(); } + const char* get_type_name()const + { + return this->do_get_type_name(); + } + + /** destroy the cloned object */ @@ -463,6 +477,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: /** @@ -473,6 +496,12 @@ namespace opt_utilities return do_clone(); } + const char* get_type_name()const + { + return this->do_get_type_name(); + } + + /** destroy the cloned object */ @@ -1604,6 +1633,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: /** clone the existing object @@ -1613,6 +1651,11 @@ namespace opt_utilities { return this->do_clone(); } + + const char* get_type_name()const + { + return this->do_get_type_name(); + } /** destroy the cloned object @@ -1747,6 +1790,12 @@ namespace opt_utilities { return do_clone(); } + + const char* get_type_name()const + { + return this->do_get_type_name(); + } + /** destroy the cloned object @@ -1756,6 +1805,15 @@ namespace opt_utilities do_destroy(); } + /** + \return the type name of self + */ + + virtual const char* do_get_type_name()const + { + return typeid(*this).name(); + } + public: /** the default construct function 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 #include +#include #ifdef DEBUG #include 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 @@ -286,6 +309,15 @@ namespace opt_utilities do_destroy(); } + /** + \return the type name of self + */ + + virtual const char* get_type_name()const + { + return this->do_get_type_name(); + } + /** deconstruct function */ -- cgit v1.2.2