Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

StatisticAccumulator.cti

Go to the documentation of this file.
00001 // $Id: StatisticAccumulator.cti 1751 2010-11-22 15:11:15Z jmo $
00002 //
00003 // Copyright (C) 2010
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Thorsten Horstmann <thorsten.horstmann@fit.fraunhofer.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 // Custom includes
00027 
00028 
00029 #define prefix_ inline
00031 
00033 // senf::StatisticAccumulator<T>
00034 
00035 template <class T>
00036 prefix_ T senf::StatisticAccumulator<T>::min()
00037     const
00038 {
00039     return min_;
00040 }
00041 
00042 template <class T>
00043 prefix_ T senf::StatisticAccumulator<T>::max()
00044     const
00045 {
00046     return max_;
00047 }
00048 
00049 template <class T>
00050 prefix_ float senf::StatisticAccumulator<T>::avg()
00051     const
00052 {
00053     return count_ == 0 ? NAN : (sum_ / float(count_));
00054 }
00055 
00056 //template <class T>
00057 //prefix_ senf::Statistics & senf::StatisticAccumulator<T>::statistics()
00058 //{
00059 //    return stats_;
00060 //}
00061 
00062 template <class T>
00063 prefix_ float senf::StatisticAccumulator<T>::last_avg()
00064     const
00065 {
00066     return last_avg_;
00067 }
00068 
00069 template <class T>
00070 prefix_ boost::uint32_t senf::StatisticAccumulator<T>::count()
00071     const
00072 {
00073     return count_;
00074 }
00075 
00077 #undef prefix_
00078 
00079 
00080 // Local Variables:
00081 // mode: c++
00082 // fill-column: 100
00083 // comment-column: 40
00084 // c-file-style: "senf"
00085 // indent-tabs-mode: nil
00086 // ispell-local-dictionary: "american"
00087 // compile-command: "scons -U"
00088 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research