A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
62  void DescribeRun (std::string experiment,
63  std::string strategy,
64  std::string input,
65  std::string runID,
66  std::string description = "");
67 
72  std::string GetExperimentLabel () const { return m_experimentLabel; }
77  std::string GetStrategyLabel () const { return m_strategyLabel; }
82  std::string GetInputLabel () const { return m_inputLabel; }
87  std::string GetRunLabel () const { return m_runLabel; }
92  std::string GetDescription () const { return m_description; }
93 
99  void AddMetadata (std::string key, std::string value);
105  void AddMetadata (std::string key, double value);
111  void AddMetadata (std::string key, uint32_t value);
116  MetadataList::iterator MetadataBegin ();
121  MetadataList::iterator MetadataEnd ();
122 
132  DataCalculatorList::iterator DataCalculatorBegin ();
137  DataCalculatorList::iterator DataCalculatorEnd ();
138 
139 protected:
140  virtual void DoDispose ();
141 
142 private:
143  std::string m_experimentLabel;
144  std::string m_strategyLabel;
145  std::string m_inputLabel;
146  std::string m_runLabel;
147  std::string m_description;
148 
151 
152  // end class DataCollector
153 };
154 
155 // end namespace ns3
156 };
157 
158 #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.
void experiment(bool enableCtsRts)
Run single 10 seconds experiment with enabled or disabled RTS/CTS mechanism.
std::list< Ptr< DataCalculator > > DataCalculatorList
List of Ptrs to DataCalculator objects.
std::string GetRunLabel() const
Return the runID label.
std::string m_description
Description label.
virtual ~DataCollector()
MetadataList::iterator MetadataBegin()
Returns an iterator to the beginning of the metadata list.
void AddDataCalculator(Ptr< DataCalculator > datac)
Add a DataCalculator object to the DataCollector.
std::string GetStrategyLabel() const
Return the strategy 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 m_runLabel
Run label.
std::string GetExperimentLabel() const
Return the experiment label.
DataCalculatorList m_calcList
List of data calculators.
std::string m_inputLabel
Input label.
Calculates data during a simulation.
Collects data.
std::string GetDescription() const
Return the description label.
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()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::string GetInputLabel() const
Return the input label.
a base class which provides memory management and object aggregation
Definition: object.h:63
MetadataList m_metadata
List of experiment metadata.
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.