A Discrete-Event Network Simulator
API
data-collector.h
Go to the documentation of this file.
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 
32 
33 //------------------------------------------------------------
34 //--------------------------------------------
38 typedef std::list<Ptr<DataCalculator> > DataCalculatorList;
42 typedef std::list<std::pair<std::string, std::string> > MetadataList;
43 
49 class DataCollector : public Object {
50 public:
51  DataCollector();
52  virtual ~DataCollector();
53 
58  static TypeId GetTypeId (void);
59 
68  void DescribeRun (std::string experiment,
69  std::string strategy,
70  std::string input,
71  std::string runID,
72  std::string description = "");
73 
78  std::string GetExperimentLabel () const { return m_experimentLabel; }
83  std::string GetStrategyLabel () const { return m_strategyLabel; }
88  std::string GetInputLabel () const { return m_inputLabel; }
93  std::string GetRunLabel () const { return m_runLabel; }
98  std::string GetDescription () const { return m_description; }
99 
105  void AddMetadata (std::string key, std::string value);
111  void AddMetadata (std::string key, double value);
117  void AddMetadata (std::string key, uint32_t value);
122  MetadataList::iterator MetadataBegin ();
127  MetadataList::iterator MetadataEnd ();
128 
138  DataCalculatorList::iterator DataCalculatorBegin ();
143  DataCalculatorList::iterator DataCalculatorEnd ();
144 
145 protected:
146  virtual void DoDispose ();
147 
148 private:
149  std::string m_experimentLabel;
150  std::string m_strategyLabel;
151  std::string m_inputLabel;
152  std::string m_runLabel;
153  std::string m_description;
154 
157 
158  // end class DataCollector
159 };
160 
161 // end namespace ns3
162 };
163 
164 #endif /* DATA_COLLECTOR_H */
std::string m_strategyLabel
Strategy label.
DataCalculatorList::iterator DataCalculatorEnd()
Returns an iterator to the past-the-end of the DataCalculator list.
std::list< Ptr< DataCalculator > > DataCalculatorList
List of Ptrs to DataCalculator objects.
std::string m_description
Description label.
std::string GetInputLabel() const
Return the input label.
std::string GetStrategyLabel() const
Return the strategy label.
virtual ~DataCollector()
MetadataList::iterator MetadataBegin()
Returns an iterator to the beginning of the metadata list.
std::string GetExperimentLabel() const
Return the experiment label.
void AddDataCalculator(Ptr< DataCalculator > datac)
Add a DataCalculator object to the DataCollector.
static TypeId GetTypeId(void)
Register this type.
std::string GetDescription() const
Return the description label.
void AddMetadata(std::string key, std::string value)
Add the key and the value as a pair of strings to the metadata list.
std::string m_experimentLabel
Experiment label.
std::string GetRunLabel() const
Return the runID label.
std::string m_runLabel
Run label.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DataCalculatorList m_calcList
List of data calculators.
std::string m_inputLabel
Input label.
void experiment(std::string queue_disc_type)
Calculates data during a simulation.
Collects data.
DataCalculatorList::iterator DataCalculatorBegin()
Returns an iterator to the beginning of the DataCalculator list.
void DescribeRun(std::string experiment, std::string strategy, std::string input, std::string runID, std::string description="")
Provide specific parameters to the DataCollector.
virtual void DoDispose()
Destructor implementation.
A base class which provides memory management and object aggregation.
Definition: object.h:87
MetadataList m_metadata
List of experiment metadata.
a unique identifier for an interface.
Definition: type-id.h:58
MetadataList::iterator MetadataEnd()
Returns an iterator to the past-the-end of the metadata list.
std::list< std::pair< std::string, std::string > > MetadataList
List of pairs of strings representing metadata.