00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026
00027
00028
00029
00030 #define prefix_ inline
00031
00032
00033
00034
00035
00036 template <class Owner>
00037 prefix_ senf::StatisticsBase::OutputProxy<Owner>::OutputProxy(Owner * owner, OutputEntry * entry)
00038 : owner_ (owner), entry_ (entry)
00039 {}
00040
00041 template <class Owner>
00042 template <class OtherOwner>
00043 prefix_ senf::StatisticsBase::OutputProxy<Owner>::
00044 OutputProxy(Owner * owner, OutputProxy<OtherOwner> const & other)
00045 : owner_ (owner), entry_ (other.entry_)
00046 {}
00047
00048 template <class Owner>
00049 template <class Target>
00050 prefix_ Owner & senf::StatisticsBase::OutputProxy<Owner>::connect(Target & target, std::string label)
00051 const
00052 {
00053 if (label.empty())
00054 label = prettyName(typeid(Target));
00055 entry_->signal.connect(boost::ref(target));
00056 entry_->targets_.push_back(new OutputEntry::Target<Target>(label));
00057 return * owner_;
00058 }
00059
00060 template <class Owner>
00061 template <class PTarget>
00062 prefix_ Owner &
00063 senf::StatisticsBase::OutputProxy<Owner>::connect(std::auto_ptr<PTarget> target, std::string label)
00064 const
00065 {
00066 if (label.empty())
00067 label = prettyName(typeid(PTarget));
00068 PTarget * targetp (target.get());
00069 entry_->targets_.push_back(new OutputEntry::Target<PTarget>(target,label));
00070 entry_->signal.connect(boost::ref(*targetp));
00071 return * owner_;
00072 }
00073
00074 template <class Owner>
00075 prefix_ Owner & senf::StatisticsBase::OutputProxy<Owner>::noconnect()
00076 const
00077 {
00078 return * owner_;
00079 }
00080
00081 template <class Owner>
00082 prefix_ senf::console::ScopedDirectory<> & senf::StatisticsBase::OutputProxy<Owner>::dir()
00083 const
00084 {
00085 return entry_->dir;
00086 }
00087
00089
00090
00091 template <class Value>
00092 prefix_ void senf::Statistics::operator()(unsigned n, StatisticAccumulator<Value> & sa)
00093 {
00094 enter(n, float(sa.min()), sa.avg(), float(sa.max()), sa.stddev());
00095 sa.clear();
00096 }
00097
00098
00099
00100 #undef prefix_
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111