diff options
| -rw-r--r-- | core/fitter.hpp | 58 | ||||
| -rw-r--r-- | core/optimizer.hpp | 32 | 
2 files changed, 90 insertions, 0 deletions
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<Ty,Tx>&)=0;
      virtual void do_clear()=0;
      virtual data_set<Ty,Tx>* 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 <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(){};  | 
