src/contrib/stats/data-collector.h
changeset 3570 44b0bc6817c6
equal deleted inserted replaced
3567:728eb3f583b3 3570:44b0bc6817c6
       
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2008 Drexel University
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License version 2 as
       
     7  * published by the Free Software Foundation;
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    17  *
       
    18  * Author: Joe Kopena (tjkopena@cs.drexel.edu)
       
    19  */
       
    20 
       
    21 #ifndef __DATA_COLLECTOR_H__
       
    22 #define __DATA_COLLECTOR_H__
       
    23 
       
    24 #include <list>
       
    25 #include <string>
       
    26 
       
    27 #include "ns3/object.h"
       
    28 
       
    29 namespace ns3 {
       
    30 
       
    31   class DataCalculator;
       
    32 
       
    33   //------------------------------------------------------------
       
    34   //--------------------------------------------
       
    35   typedef std::list<Ptr<DataCalculator> > DataCalculatorList;
       
    36   typedef std::list<std::pair<std::string, std::string> > MetadataList;
       
    37 
       
    38   class DataCollector : public Object {
       
    39   public:
       
    40     DataCollector();
       
    41     virtual ~DataCollector();
       
    42 
       
    43     void DescribeRun(std::string experiment,
       
    44                      std::string strategy,
       
    45                      std::string input,
       
    46                      std::string runID,
       
    47                      std::string description = "");
       
    48 
       
    49     std::string GetExperimentLabel() const { return m_experimentLabel; }
       
    50     std::string GetStrategyLabel() const { return m_strategyLabel; }
       
    51     std::string GetInputLabel() const { return m_inputLabel; }
       
    52     std::string GetRunLabel() const { return m_runLabel; }
       
    53     std::string GetDescription() const { return m_description; }
       
    54 
       
    55     void AddMetadata(std::string key, std::string value);
       
    56     void AddMetadata(std::string key, double value);
       
    57     void AddMetadata(std::string key, uint32_t value);
       
    58     MetadataList::iterator MetadataBegin();
       
    59     MetadataList::iterator MetadataEnd();
       
    60 
       
    61     void AddDataCalculator(Ptr<DataCalculator> datac);
       
    62     DataCalculatorList::iterator DataCalculatorBegin();
       
    63     DataCalculatorList::iterator DataCalculatorEnd();
       
    64 
       
    65   protected:
       
    66     virtual void DoDispose();
       
    67 
       
    68   private:
       
    69     std::string m_experimentLabel;
       
    70     std::string m_strategyLabel;
       
    71     std::string m_inputLabel;
       
    72     std::string m_runLabel;
       
    73     std::string m_description;
       
    74 
       
    75     MetadataList m_metadata;
       
    76     DataCalculatorList m_calcList;
       
    77 
       
    78     // end class DataCollector
       
    79   };
       
    80 
       
    81   // end namespace ns3
       
    82 };
       
    83 
       
    84 #endif // __DATA_COLLECTOR_H__