2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief StatisticsTargets internal header */
17 #ifndef IH_SENF_Utils_StatisticsTargets_
18 #define IH_SENF_Utils_StatisticsTargets_ 1
22 #include <senf/Utils/singleton.hh>
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
28 namespace console { class DirectoryNode; }
34 class StatisticsLoggerRegistry
35 : public senf::singleton<StatisticsLoggerRegistry>
38 typedef void (*AddFn)(senf::StatisticsBase &, unsigned,
39 senf::console::DirectoryNode &);
41 using senf::singleton<StatisticsLoggerRegistry>::instance;
42 using senf::singleton<StatisticsLoggerRegistry>::alive;
45 void apply(senf::StatisticsBase & stats, unsigned rank,
46 senf::console::DirectoryNode & dir);
49 typedef std::vector<AddFn> Adders;
53 template <class Stream=void, class Area=void, class Level=void>
54 struct StatisticsLogger
57 StatisticsLogger(std::string const & label_);
58 void operator()(unsigned cnt, float min, float avg, float max, float dev);
65 //-/////////////////////////////////////////////////////////////////////////////////////////////////
73 // c-file-style: "senf"
74 // indent-tabs-mode: nil
75 // ispell-local-dictionary: "american"
76 // compile-command: "scons -u test"