00001 #include "FastShowerUtils/DebugBase.h" 00002 #include "FastShowerUtils/Pinger/IPinger.h" 00003 #include "FastShowerUtils/IFunctionStats.h" 00004 #include "FastShowerUtils/FunctionStats.h" 00005 #include "FastShowerUtils/FunctionStatsDist.h" 00006 #include "FastShowerUtils/ParticleParameters.h" 00007 #include <iostream> 00008 #include <vector> 00009 #include <typeinfo> 00010 00011 namespace FastShower{ 00013 DebugBase::DebugBase(std::string s): 00014 //m_stats(new FunctionStatsDist(s)), 00015 m_stats(new FunctionStats), 00016 m_text(s){ 00017 } 00019 // 00020 DebugBase::DebugBase(const DebugBase& rhs ){ 00021 m_stats=rhs.m_stats; 00022 m_text=rhs.m_text; 00023 } 00025 // 00026 DebugBase& DebugBase::operator=(const DebugBase& rhs){ 00027 if(&rhs == this) return *this; 00028 00029 m_stats=rhs.m_stats; 00030 m_text=rhs.m_text; 00031 00032 return *this; 00033 } 00036 void DebugBase::ping(IPinger& p) const { 00037 p.action(this); 00038 } 00040 std::string DebugBase::name() const { 00041 //amateurish attemp to get rid of some of the name-mangling 00042 std::string str(typeid(*this).name(), 12, string::npos); 00043 return str; 00044 } 00046 std::string DebugBase::text() const {return m_text;} 00048 void DebugBase::bumpStats(double x) const{ m_stats->bump(x);} 00050 void DebugBase::bumpStats(double x, const ParticleParameters* pp) const{ 00051 m_stats->bump(x, pp); 00052 } 00054 void DebugBase::components(IDebug::Cpts&) const{} 00055 const IFunctionStats* DebugBase::statistics() const{return m_stats;} 00057 void DebugBase::arm() const {m_stats->prime();} 00058 }//namespace 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068