A Discrete-Event Network Simulator
API
file-helper.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 University of Washington
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: Mitch Watrous (watrous@u.washington.edu)
18  */
19 
20 #include "file-helper.h"
21 
22 #include "ns3/abort.h"
23 #include "ns3/config.h"
24 #include "ns3/get-wildcard-matches.h"
25 #include "ns3/log.h"
26 
27 #include <fstream>
28 #include <iostream>
29 #include <string>
30 
31 namespace ns3
32 {
33 
34 NS_LOG_COMPONENT_DEFINE("FileHelper");
35 
37  : m_aggregator(nullptr),
38  m_fileProbeCount(0),
39  m_fileType(FileAggregator::SPACE_SEPARATED),
40  m_outputFileNameWithoutExtension("file-helper"),
41  m_hasHeadingBeenSet(false)
42 {
43  NS_LOG_FUNCTION(this);
44 
45  // Note that this does not construct an aggregator. It will be
46  // constructed later when needed.
47 }
48 
49 FileHelper::FileHelper(const std::string& outputFileNameWithoutExtension,
50  FileAggregator::FileType fileType)
51  : m_aggregator(nullptr),
52  m_fileProbeCount(0),
53  m_fileType(fileType),
54  m_outputFileNameWithoutExtension(outputFileNameWithoutExtension),
55  m_hasHeadingBeenSet(false)
56 {
57  NS_LOG_FUNCTION(this);
58 
59  // Note that this does not construct an aggregator. It will be
60  // constructed later when needed.
61 }
62 
64 {
65  NS_LOG_FUNCTION(this);
66 }
67 
68 void
69 FileHelper::ConfigureFile(const std::string& outputFileNameWithoutExtension,
70  FileAggregator::FileType fileType)
71 {
72  NS_LOG_FUNCTION(this << outputFileNameWithoutExtension << fileType);
73 
74  // See if an aggregator has already been constructed.
75  if (m_aggregator)
76  {
77  NS_LOG_WARN("An existing aggregator object "
78  << m_aggregator << " may be destroyed if no references remain.");
79  }
80 
81  // Store these so that they can be used to construct the aggregator.
82  m_fileType = fileType;
83  m_outputFileNameWithoutExtension = outputFileNameWithoutExtension;
84  m_hasHeadingBeenSet = false;
85 
86  // Note that this does not construct an aggregator. It will be
87  // constructed later when needed.
88 }
89 
90 void
91 FileHelper::WriteProbe(const std::string& typeId,
92  const std::string& path,
93  const std::string& probeTraceSource)
94 {
95  NS_LOG_FUNCTION(this << typeId << path << probeTraceSource);
96 
97  std::string pathWithoutLastToken;
98  std::string lastToken;
99 
100  // See if the path has any wildcards.
101  bool pathHasNoWildcards = path.find('*') == std::string::npos;
102 
103  // Remove the last token from the path.
104  size_t lastSlash = path.find_last_of('/');
105  if (lastSlash == std::string::npos)
106  {
107  pathWithoutLastToken = path;
108  lastToken = "";
109  }
110  else
111  {
112  // Chop off up to last token.
113  pathWithoutLastToken = path.substr(0, lastSlash);
114 
115  // Save the last token without the last slash.
116  lastToken = path.substr(lastSlash + 1, std::string::npos);
117  }
118 
119  // See if there are any matches for the probe's path with the last
120  // token removed.
121  Config::MatchContainer matches = Config::LookupMatches(pathWithoutLastToken);
122  uint32_t matchCount = matches.GetN();
123 
124  // This is used to make the probe's context be unique.
125  std::string matchIdentifier;
126 
128  bool onlyOneAggregator;
129 
130  // Hook one or more probes and one or more aggregators together.
131  if (matchCount == 1 && pathHasNoWildcards)
132  {
133  // Connect the probe to the aggregator only once because there
134  // is only one matching config path. There is no need to find
135  // the wildcard matches because the passed in path has none.
136  matchIdentifier = "0";
137  onlyOneAggregator = true;
139  matchIdentifier,
140  path,
141  probeTraceSource,
143  onlyOneAggregator);
144  }
145  else if (matchCount > 0)
146  {
147  // Handle all of the matches if there are more than one.
148  for (uint32_t i = 0; i < matchCount; i++)
149  {
150  // Set the match identifier.
151  std::ostringstream matchIdentifierStream;
152  matchIdentifierStream << i;
153  matchIdentifier = matchIdentifierStream.str();
154  onlyOneAggregator = false;
155 
156  // Construct the matched path and get the matches for each
157  // of the wildcards.
158  std::string wildcardSeparator = "-";
159  std::string matchedPath = matches.GetMatchedPath(i) + lastToken;
160  std::string wildcardMatches = GetWildcardMatches(path, matchedPath, wildcardSeparator);
161 
162  // Connect the probe to the aggregator for this match.
164  matchIdentifier,
165  matchedPath,
166  probeTraceSource,
167  m_outputFileNameWithoutExtension + "-" + wildcardMatches,
168  onlyOneAggregator);
169  }
170  }
171  else
172  {
173  // There is a problem if there are no matching config paths.
174  NS_FATAL_ERROR("Lookup of " << path << " got no matches");
175  }
176 }
177 
178 void
179 FileHelper::AddProbe(const std::string& typeId,
180  const std::string& probeName,
181  const std::string& path)
182 {
183  NS_LOG_FUNCTION(this << typeId << probeName << path);
184 
185  // See if this probe had already been added.
186  if (m_probeMap.count(probeName) > 0)
187  {
188  NS_ABORT_MSG("That probe has already been added");
189  }
190 
191  // Prepare the factory to create an object with the requested type.
192  m_factory.SetTypeId(typeId);
193 
194  // Create a base class object in order to validate the type.
195  Ptr<Probe> probe = m_factory.Create()->GetObject<Probe>();
196  if (!probe)
197  {
198  NS_ABORT_MSG("The requested type is not a probe");
199  }
200 
201  // Set the probe's name.
202  probe->SetName(probeName);
203 
204  // Set the path. Note that no return value is checked here.
205  probe->ConnectByPath(path);
206 
207  // Enable logging of data for the probe.
208  probe->Enable();
209 
210  // Add this probe to the map so that its values can be used.
211  m_probeMap[probeName] = std::make_pair(probe, typeId);
212 }
213 
214 void
215 FileHelper::AddTimeSeriesAdaptor(const std::string& adaptorName)
216 {
217  NS_LOG_FUNCTION(this << adaptorName);
218 
219  // See if this time series adaptor had already been added.
220  if (m_timeSeriesAdaptorMap.count(adaptorName) > 0)
221  {
222  NS_ABORT_MSG("That time series adaptor has already been added");
223  }
224 
225  // Create the time series adaptor.
226  Ptr<TimeSeriesAdaptor> timeSeriesAdaptor = CreateObject<TimeSeriesAdaptor>();
227 
228  // Enable logging of data for the time series adaptor.
229  timeSeriesAdaptor->Enable();
230 
231  // Add this time series adaptor to the map so that it can be used.
232  m_timeSeriesAdaptorMap[adaptorName] = timeSeriesAdaptor;
233 }
234 
235 void
236 FileHelper::AddAggregator(const std::string& aggregatorName,
237  const std::string& outputFileName,
238  bool onlyOneAggregator)
239 {
240  NS_LOG_FUNCTION(this << aggregatorName << outputFileName << onlyOneAggregator);
241 
242  // See if this file aggregator had already been added.
243  if (m_aggregatorMap.count(aggregatorName) > 0)
244  {
245  NS_ABORT_MSG("That file aggregator has already been added");
246  }
247 
248  // If there is only going to be 1 file aggregator, then use the one
249  // already constructed in the map.
250  if (onlyOneAggregator)
251  {
252  // Get a pointer to the aggregator.
253  Ptr<FileAggregator> singleAggregator = GetAggregatorSingle();
254 
255  m_aggregatorMap[aggregatorName] = singleAggregator;
256  return;
257  }
258 
259  // Create the file aggregator with the proper file type.
260  Ptr<FileAggregator> multipleAggregator =
261  CreateObject<FileAggregator>(outputFileName, m_fileType);
262 
263  // Set all of the format strings for the aggregator.
264  multipleAggregator->Set1dFormat(m_1dFormat);
265  multipleAggregator->Set2dFormat(m_2dFormat);
266  multipleAggregator->Set3dFormat(m_3dFormat);
267  multipleAggregator->Set4dFormat(m_4dFormat);
268  multipleAggregator->Set5dFormat(m_5dFormat);
269  multipleAggregator->Set6dFormat(m_6dFormat);
270  multipleAggregator->Set7dFormat(m_7dFormat);
271  multipleAggregator->Set8dFormat(m_8dFormat);
272  multipleAggregator->Set9dFormat(m_9dFormat);
273  multipleAggregator->Set10dFormat(m_10dFormat);
274 
275  // Set the heading
276  multipleAggregator->SetHeading(m_heading);
277 
278  // Enable logging of data for the file aggregator.
279  multipleAggregator->Enable();
280 
281  // Add this file aggregator to the map so that it can be used.
282  m_aggregatorMap[aggregatorName] = multipleAggregator;
283 }
284 
286 FileHelper::GetProbe(std::string probeName) const
287 {
288  NS_LOG_FUNCTION(this << probeName);
289 
290  // Look for the probe.
291  auto mapIterator = m_probeMap.find(probeName);
292 
293  // Return the probe if it has been added.
294  if (mapIterator != m_probeMap.end())
295  {
296  return mapIterator->second.first;
297  }
298  else
299  {
300  NS_ABORT_MSG("That probe has not been added");
301  }
302 }
303 
306 {
307  NS_LOG_FUNCTION(this);
308 
309  // Do a lazy construction of the single aggregator if it hasn't
310  // already been constructed.
311  if (!m_aggregator)
312  {
313  // Create the aggregator.
314  std::string outputFileName = m_outputFileNameWithoutExtension + ".txt";
315  m_aggregator = CreateObject<FileAggregator>(outputFileName, m_fileType);
316 
317  // Set all of the format strings for the aggregator.
318  m_aggregator->Set1dFormat(m_1dFormat);
319  m_aggregator->Set2dFormat(m_2dFormat);
320  m_aggregator->Set3dFormat(m_3dFormat);
321  m_aggregator->Set4dFormat(m_4dFormat);
322  m_aggregator->Set5dFormat(m_5dFormat);
323  m_aggregator->Set6dFormat(m_6dFormat);
324  m_aggregator->Set7dFormat(m_7dFormat);
325  m_aggregator->Set8dFormat(m_8dFormat);
326  m_aggregator->Set9dFormat(m_9dFormat);
327  m_aggregator->Set10dFormat(m_10dFormat);
328 
329  // Set the heading
330  m_aggregator->SetHeading(m_heading);
331 
332  // Enable logging of data for the aggregator.
333  m_aggregator->Enable();
334  }
335  return m_aggregator;
336 }
337 
339 FileHelper::GetAggregatorMultiple(const std::string& aggregatorName,
340  const std::string& outputFileName)
341 {
342  NS_LOG_FUNCTION(this);
343 
344  // See if this file aggregator had already been added.
345  if (m_aggregatorMap.count(aggregatorName) > 0)
346  {
347  return m_aggregatorMap[aggregatorName];
348  }
349 
350  // Do a lazy construction of the aggregator if it hasn't already
351  // been constructed.
352  bool onlyOneAggregator = false;
353  AddAggregator(aggregatorName, outputFileName, onlyOneAggregator);
354 
355  return m_aggregatorMap[aggregatorName];
356 }
357 
358 void
359 FileHelper::SetHeading(const std::string& heading)
360 {
361  NS_LOG_FUNCTION(this << heading);
362 
363  m_hasHeadingBeenSet = true;
364  m_heading = heading;
365 }
366 
367 void
368 FileHelper::Set1dFormat(const std::string& format)
369 {
370  NS_LOG_FUNCTION(this << format);
371 
372  m_1dFormat = format;
373 }
374 
375 void
376 FileHelper::Set2dFormat(const std::string& format)
377 {
378  NS_LOG_FUNCTION(this << format);
379 
380  m_2dFormat = format;
381 }
382 
383 void
384 FileHelper::Set3dFormat(const std::string& format)
385 {
386  NS_LOG_FUNCTION(this << format);
387 
388  m_3dFormat = format;
389 }
390 
391 void
392 FileHelper::Set4dFormat(const std::string& format)
393 {
394  NS_LOG_FUNCTION(this << format);
395 
396  m_4dFormat = format;
397 }
398 
399 void
400 FileHelper::Set5dFormat(const std::string& format)
401 {
402  NS_LOG_FUNCTION(this << format);
403 
404  m_5dFormat = format;
405 }
406 
407 void
408 FileHelper::Set6dFormat(const std::string& format)
409 {
410  NS_LOG_FUNCTION(this << format);
411 
412  m_6dFormat = format;
413 }
414 
415 void
416 FileHelper::Set7dFormat(const std::string& format)
417 {
418  NS_LOG_FUNCTION(this << format);
419 
420  m_7dFormat = format;
421 }
422 
423 void
424 FileHelper::Set8dFormat(const std::string& format)
425 {
426  NS_LOG_FUNCTION(this << format);
427 
428  m_8dFormat = format;
429 }
430 
431 void
432 FileHelper::Set9dFormat(const std::string& format)
433 {
434  NS_LOG_FUNCTION(this << format);
435 
436  m_9dFormat = format;
437 }
438 
439 void
440 FileHelper::Set10dFormat(const std::string& format)
441 {
442  NS_LOG_FUNCTION(this << format);
443 
444  m_10dFormat = format;
445 }
446 
447 void
448 FileHelper::ConnectProbeToAggregator(const std::string& typeId,
449  const std::string& matchIdentifier,
450  const std::string& path,
451  const std::string& probeTraceSource,
452  const std::string& outputFileNameWithoutExtension,
453  bool onlyOneAggregator)
454 {
455  NS_LOG_FUNCTION(this << typeId << matchIdentifier << path << probeTraceSource
456  << outputFileNameWithoutExtension << onlyOneAggregator);
457 
458  // Increment the total number of file probes that have been created.
460 
461  // Create a unique name for this probe.
462  std::ostringstream probeNameStream;
463  probeNameStream << "FileProbe-" << m_fileProbeCount;
464  std::string probeName = probeNameStream.str();
465 
466  // Create a unique dataset context string for this probe.
467  std::string probeContext = probeName + "/" + matchIdentifier + "/" + probeTraceSource;
468 
469  // Add the probe to the map of probes, which will keep the probe in
470  // memory after this function ends.
471  AddProbe(typeId, probeName, path);
472 
473  // Because the callbacks to the probes' trace sources don't use the
474  // probe's context, a unique adaptor needs to be created for each
475  // probe context so that information is not lost.
476  AddTimeSeriesAdaptor(probeContext);
477 
478  // Connect the probe to the adaptor.
479  if (m_probeMap[probeName].second == "ns3::DoubleProbe")
480  {
481  m_probeMap[probeName].first->TraceConnectWithoutContext(
482  probeTraceSource,
484  m_timeSeriesAdaptorMap[probeContext]));
485  }
486  else if (m_probeMap[probeName].second == "ns3::BooleanProbe")
487  {
488  m_probeMap[probeName].first->TraceConnectWithoutContext(
489  probeTraceSource,
491  m_timeSeriesAdaptorMap[probeContext]));
492  }
493  else if (m_probeMap[probeName].second == "ns3::PacketProbe")
494  {
495  m_probeMap[probeName].first->TraceConnectWithoutContext(
496  probeTraceSource,
498  m_timeSeriesAdaptorMap[probeContext]));
499  }
500  else if (m_probeMap[probeName].second == "ns3::ApplicationPacketProbe")
501  {
502  m_probeMap[probeName].first->TraceConnectWithoutContext(
503  probeTraceSource,
505  m_timeSeriesAdaptorMap[probeContext]));
506  }
507  else if (m_probeMap[probeName].second == "ns3::Ipv4PacketProbe")
508  {
509  m_probeMap[probeName].first->TraceConnectWithoutContext(
510  probeTraceSource,
512  m_timeSeriesAdaptorMap[probeContext]));
513  }
514  else if (m_probeMap[probeName].second == "ns3::Ipv6PacketProbe")
515  {
516  m_probeMap[probeName].first->TraceConnectWithoutContext(
517  probeTraceSource,
519  m_timeSeriesAdaptorMap[probeContext]));
520  }
521  else if (m_probeMap[probeName].second == "ns3::Uinteger8Probe")
522  {
523  m_probeMap[probeName].first->TraceConnectWithoutContext(
524  probeTraceSource,
526  m_timeSeriesAdaptorMap[probeContext]));
527  }
528  else if (m_probeMap[probeName].second == "ns3::Uinteger16Probe")
529  {
530  m_probeMap[probeName].first->TraceConnectWithoutContext(
531  probeTraceSource,
533  m_timeSeriesAdaptorMap[probeContext]));
534  }
535  else if (m_probeMap[probeName].second == "ns3::Uinteger32Probe")
536  {
537  m_probeMap[probeName].first->TraceConnectWithoutContext(
538  probeTraceSource,
540  m_timeSeriesAdaptorMap[probeContext]));
541  }
542  else if (m_probeMap[probeName].second == "ns3::TimeProbe")
543  {
544  m_probeMap[probeName].first->TraceConnectWithoutContext(
545  probeTraceSource,
547  m_timeSeriesAdaptorMap[probeContext]));
548  }
549  else
550  {
551  NS_FATAL_ERROR("Unknown probe type " << m_probeMap[probeName].second
552  << "; need to add support in the helper for this");
553  }
554 
555  // Add the aggregator to the map of aggregators, which will keep the
556  // aggregator in memory after this function ends.
557  std::string outputFileName = outputFileNameWithoutExtension + ".txt";
558  AddAggregator(probeContext, outputFileName, onlyOneAggregator);
559 
560  // Connect the adaptor to the aggregator.
561  std::string adaptorTraceSource = "Output";
562  m_timeSeriesAdaptorMap[probeContext]->TraceConnect(
563  adaptorTraceSource,
564  probeContext,
566 }
567 
568 } // namespace ns3
hold a set of objects which match a specific search string.
Definition: config.h:195
std::string GetMatchedPath(uint32_t i) const
Definition: config.cc:89
std::size_t GetN() const
Definition: config.cc:75
This aggregator sends values it receives to a file.
void Write2d(std::string context, double v1, double v2)
Writes 2 values to the file.
FileType
The type of file written by the aggregator.
void Set2dFormat(const std::string &format)
Sets the 2D format string for the C-style sprintf() function.
Definition: file-helper.cc:376
void SetHeading(const std::string &heading)
Sets the heading string that will be printed on the first line of the file.
Definition: file-helper.cc:359
void Set5dFormat(const std::string &format)
Sets the 5D format string for the C-style sprintf() function.
Definition: file-helper.cc:400
void AddTimeSeriesAdaptor(const std::string &adaptorName)
Adds a time series adaptor to be used to write the file.
Definition: file-helper.cc:215
Ptr< FileAggregator > GetAggregatorSingle()
Gets the single aggregator that is always constructed.
Definition: file-helper.cc:305
std::string m_6dFormat
Format string for 6D format C-style sprintf() function.
Definition: file-helper.h:317
std::map< std::string, std::pair< Ptr< Probe >, std::string > > m_probeMap
Maps probe names to probes.
Definition: file-helper.h:292
void Set3dFormat(const std::string &format)
Sets the 3D format string for the C-style sprintf() function.
Definition: file-helper.cc:384
Ptr< Probe > GetProbe(std::string probeName) const
Gets the specified probe.
Definition: file-helper.cc:286
std::map< std::string, Ptr< TimeSeriesAdaptor > > m_timeSeriesAdaptorMap
Maps time series adaptor names to time series adaptors.
Definition: file-helper.h:295
void WriteProbe(const std::string &typeId, const std::string &path, const std::string &probeTraceSource)
Definition: file-helper.cc:91
std::map< std::string, Ptr< FileAggregator > > m_aggregatorMap
Maps aggregator names to aggregators when multiple aggregators are needed.
Definition: file-helper.h:289
FileHelper()
Constructs a file helper that will create a space separated file named "file-helper....
Definition: file-helper.cc:36
void Set6dFormat(const std::string &format)
Sets the 6D format string for the C-style sprintf() function.
Definition: file-helper.cc:408
ObjectFactory m_factory
Used to create the probes and collectors as they are added.
Definition: file-helper.h:282
uint32_t m_fileProbeCount
Number of file probes that have been created.
Definition: file-helper.h:298
std::string m_heading
Heading line for the outputfile.
Definition: file-helper.h:310
std::string m_outputFileNameWithoutExtension
The name of the output file to created without its extension.
Definition: file-helper.h:304
std::string m_8dFormat
Format string for 8D format C-style sprintf() function.
Definition: file-helper.h:319
std::string m_9dFormat
Format string for 9D format C-style sprintf() function.
Definition: file-helper.h:320
void ConfigureFile(const std::string &outputFileNameWithoutExtension, FileAggregator::FileType fileType=FileAggregator::SPACE_SEPARATED)
Definition: file-helper.cc:69
bool m_hasHeadingBeenSet
Indicates if the heading line for the file has been set.
Definition: file-helper.h:307
std::string m_2dFormat
Format string for 2D format C-style sprintf() function.
Definition: file-helper.h:313
void AddAggregator(const std::string &aggregatorName, const std::string &outputFileName, bool onlyOneAggregator)
Adds an aggregator to be used to write values to files.
Definition: file-helper.cc:236
void Set1dFormat(const std::string &format)
Sets the 1D format string for the C-style sprintf() function.
Definition: file-helper.cc:368
void AddProbe(const std::string &typeId, const std::string &probeName, const std::string &path)
Adds a probe to be used to write values to files.
Definition: file-helper.cc:179
std::string m_1dFormat
Format string for 1D format C-style sprintf() function.
Definition: file-helper.h:312
std::string m_10dFormat
Format string for 10D format C-style sprintf() function.
Definition: file-helper.h:321
std::string m_4dFormat
Format string for 4D format C-style sprintf() function.
Definition: file-helper.h:315
std::string m_7dFormat
Format string for 7D format C-style sprintf() function.
Definition: file-helper.h:318
void Set4dFormat(const std::string &format)
Sets the 4D format string for the C-style sprintf() function.
Definition: file-helper.cc:392
void Set7dFormat(const std::string &format)
Sets the 7D format string for the C-style sprintf() function.
Definition: file-helper.cc:416
FileAggregator::FileType m_fileType
Determines the kind of file written by the aggregator.
Definition: file-helper.h:301
Ptr< FileAggregator > m_aggregator
The single aggregator that is always created in the constructor.
Definition: file-helper.h:285
virtual ~FileHelper()
Definition: file-helper.cc:63
std::string m_5dFormat
Format string for 5D format C-style sprintf() function.
Definition: file-helper.h:316
std::string m_3dFormat
Format string for 3D format C-style sprintf() function.
Definition: file-helper.h:314
void Set8dFormat(const std::string &format)
Sets the 8D format string for the C-style sprintf() function.
Definition: file-helper.cc:424
Ptr< FileAggregator > GetAggregatorMultiple(const std::string &aggregatorName, const std::string &outputFileName)
Gets one of the multiple aggregators from the map.
Definition: file-helper.cc:339
void Set10dFormat(const std::string &format)
Sets the 10D format string for the C-style sprintf() function.
Definition: file-helper.cc:440
void ConnectProbeToAggregator(const std::string &typeId, const std::string &matchIdentifier, const std::string &path, const std::string &probeTraceSource, const std::string &outputFileNameWithoutExtension, bool onlyOneAggregator)
Connects the probe to the aggregator.
Definition: file-helper.cc:448
void Set9dFormat(const std::string &format)
Sets the 9D format string for the C-style sprintf() function.
Definition: file-helper.cc:432
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition: object.h:471
Base class for probes.
Definition: probe.h:41
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
void TraceSinkUinteger8(uint8_t oldData, uint8_t newData)
Trace sink for receiving data from uint8_t valued trace sources.
void TraceSinkDouble(double oldData, double newData)
Trace sink for receiving data from double valued trace sources.
void TraceSinkBoolean(bool oldData, bool newData)
Trace sink for receiving data from bool valued trace sources.
void TraceSinkUinteger32(uint32_t oldData, uint32_t newData)
Trace sink for receiving data from uint32_t valued trace sources.
void TraceSinkUinteger16(uint16_t oldData, uint16_t newData)
Trace sink for receiving data from uint16_t valued trace sources.
MatchContainer LookupMatches(std::string path)
Definition: config.cc:998
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:49
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:261
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:704
std::string GetWildcardMatches(const std::string &configPath, const std::string &matchedPath, const std::string &wildcardSeparator)
Returns the text matches from the matched path for each of the wildcards in the Config path,...
Definition: second.py:1