A Discrete-Event Network Simulator
API
data-collector.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 Drexel University
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Joe Kopena (tjkopena@cs.drexel.edu)
18  */
19 
20 #ifndef DATA_COLLECTOR_H
21 #define DATA_COLLECTOR_H
22 
23 #include "ns3/object.h"
24 
25 #include <list>
26 #include <string>
27 
28 namespace ns3
29 {
30 
31 class DataCalculator;
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 {
51  public:
52  DataCollector();
53  ~DataCollector() override;
54 
59  static TypeId GetTypeId();
60 
69  void DescribeRun(std::string experiment,
70  std::string strategy,
71  std::string input,
72  std::string runID,
73  std::string description = "");
74 
79  std::string GetExperimentLabel() const
80  {
81  return m_experimentLabel;
82  }
83 
88  std::string GetStrategyLabel() const
89  {
90  return m_strategyLabel;
91  }
92 
97  std::string GetInputLabel() const
98  {
99  return m_inputLabel;
100  }
101 
106  std::string GetRunLabel() const
107  {
108  return m_runLabel;
109  }
110 
115  std::string GetDescription() const
116  {
117  return m_description;
118  }
119 
125  void AddMetadata(std::string key, std::string value);
131  void AddMetadata(std::string key, double value);
137  void AddMetadata(std::string key, uint32_t value);
142  MetadataList::iterator MetadataBegin();
147  MetadataList::iterator MetadataEnd();
148 
158  DataCalculatorList::iterator DataCalculatorBegin();
163  DataCalculatorList::iterator DataCalculatorEnd();
164 
165  protected:
166  void DoDispose() override;
167 
168  private:
169  std::string m_experimentLabel;
170  std::string m_strategyLabel;
171  std::string m_inputLabel;
172  std::string m_runLabel;
173  std::string m_description;
174 
177 
178  // end class DataCollector
179 };
180 
181 // end namespace ns3
182 }; // namespace ns3
183 
184 #endif /* DATA_COLLECTOR_H */
Collects data.
std::string m_strategyLabel
Strategy label.
void DoDispose() override
Destructor implementation.
static TypeId GetTypeId()
Register this type.
std::string GetExperimentLabel() const
Return the experiment label.
DataCalculatorList::iterator DataCalculatorBegin()
Returns an iterator to the beginning of the DataCalculator list.
DataCalculatorList::iterator DataCalculatorEnd()
Returns an iterator to the past-the-end of the DataCalculator list.
std::string GetDescription() const
Return the description label.
std::string m_experimentLabel
Experiment label.
MetadataList::iterator MetadataBegin()
Returns an iterator to the beginning of the metadata list.
DataCalculatorList m_calcList
List of data calculators.
MetadataList::iterator MetadataEnd()
Returns an iterator to the past-the-end of the metadata list.
std::string m_description
Description label.
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_inputLabel
Input label.
std::string GetRunLabel() const
Return the runID label.
void AddDataCalculator(Ptr< DataCalculator > datac)
Add a DataCalculator object to the DataCollector.
~DataCollector() override
MetadataList m_metadata
List of experiment metadata.
void DescribeRun(std::string experiment, std::string strategy, std::string input, std::string runID, std::string description="")
Provide specific parameters to the DataCollector.
std::string m_runLabel
Run label.
std::string GetInputLabel() const
Return the input label.
A base class which provides memory management and object aggregation.
Definition: object.h:89
a unique identifier for an interface.
Definition: type-id.h:59
void experiment(std::string queue_disc_type)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::list< Ptr< DataCalculator > > DataCalculatorList
List of Ptrs to DataCalculator objects.
std::list< std::pair< std::string, std::string > > MetadataList
List of pairs of strings representing metadata.