A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
file-helper.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 University of Washington
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: Mitch Watrous (watrous@u.washington.edu)
19  */
20 
21 #include <iostream>
22 #include <fstream>
23 #include <string>
24 
25 #include "file-helper.h"
26 #include "ns3/abort.h"
27 #include "ns3/log.h"
28 #include "ns3/config.h"
29 #include "ns3/get-wildcard-matches.h"
30 
31 namespace ns3 {
32 
33 NS_LOG_COMPONENT_DEFINE ("FileHelper")
34  ;
35 
37  : m_aggregator (0),
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  enum FileAggregator::FileType fileType)
51  : m_aggregator (0),
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  enum 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 != 0)
76  {
77  NS_LOG_WARN ("An existing aggregator object " << m_aggregator <<
78  " 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;
138  ConnectProbeToAggregator (typeId,
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,
161  matchedPath,
162  wildcardSeparator);
163 
164  // Connect the probe to the aggregator for this match.
165  ConnectProbeToAggregator (typeId,
166  matchIdentifier,
167  matchedPath,
168  probeTraceSource,
169  m_outputFileNameWithoutExtension + "-" + wildcardMatches,
170  onlyOneAggregator);
171  }
172  }
173  else
174  {
175  // There is a problem if there are no matching config paths.
176  NS_FATAL_ERROR ("Lookup of " << path << " got no matches");
177  }
178 }
179 
180 void
181 FileHelper::AddProbe (const std::string &typeId,
182  const std::string &probeName,
183  const std::string &path)
184 {
185  NS_LOG_FUNCTION (this << typeId << probeName << path);
186 
187  // See if this probe had already been added.
188  if (m_probeMap.count (probeName) > 0)
189  {
190  NS_ABORT_MSG ("That probe has already been added");
191  }
192 
193  // Prepare the factory to create an object with the requested type.
194  m_factory.SetTypeId (typeId);
195 
196  // Create a base class object in order to validate the type.
197  Ptr<Probe> probe = m_factory.Create ()->GetObject<Probe> ();
198  if (probe == 0)
199  {
200  NS_ABORT_MSG ("The requested type is not a probe");
201  }
202 
203  // Set the probe's name.
204  probe->SetName (probeName);
205 
206  // Set the path. Note that no return value is checked here.
207  probe->ConnectByPath (path);
208 
209  // Enable logging of data for the probe.
210  probe->Enable ();
211 
212  // Add this probe to the map so that its values can be used.
213  m_probeMap[probeName] = std::make_pair (probe, typeId);
214 }
215 
216 void
217 FileHelper::AddTimeSeriesAdaptor (const std::string &adaptorName)
218 {
219  NS_LOG_FUNCTION (this << adaptorName);
220 
221  // See if this time series adaptor had already been added.
222  if (m_timeSeriesAdaptorMap.count (adaptorName) > 0)
223  {
224  NS_ABORT_MSG ("That time series adaptor has already been added");
225  }
226 
227  // Create the time series adaptor.
228  Ptr<TimeSeriesAdaptor> timeSeriesAdaptor = CreateObject<TimeSeriesAdaptor> ();
229 
230  // Enable logging of data for the time series adaptor.
231  timeSeriesAdaptor->Enable ();
232 
233  // Add this time series adaptor to the map so that it can be used.
234  m_timeSeriesAdaptorMap[adaptorName] = timeSeriesAdaptor;
235 }
236 
237 void
238 FileHelper::AddAggregator (const std::string &aggregatorName,
239  const std::string &outputFileName,
240  bool onlyOneAggregator)
241 {
242  NS_LOG_FUNCTION (this << aggregatorName << outputFileName << onlyOneAggregator);
243 
244  // See if this file aggregator had already been added.
245  if (m_aggregatorMap.count (aggregatorName) > 0)
246  {
247  NS_ABORT_MSG ("That file aggregator has already been added");
248  }
249 
250  // If there is only going to be 1 file aggregator, then use the one
251  // already constructed in the map.
252  if (onlyOneAggregator)
253  {
254  // Get a pointer to the aggregator.
255  Ptr<FileAggregator> singleAggregator = GetAggregatorSingle ();
256 
257  m_aggregatorMap[aggregatorName] = singleAggregator;
258  return;
259  }
260 
261  // Create the file aggregator with the proper file type.
262  Ptr<FileAggregator> multipleAggregator =
263  CreateObject<FileAggregator> (outputFileName, m_fileType);
264 
265  // Set all of the format strings for the aggregator.
266  multipleAggregator->Set1dFormat (m_1dFormat);
267  multipleAggregator->Set2dFormat (m_2dFormat);
268  multipleAggregator->Set3dFormat (m_3dFormat);
269  multipleAggregator->Set4dFormat (m_4dFormat);
270  multipleAggregator->Set5dFormat (m_5dFormat);
271  multipleAggregator->Set6dFormat (m_6dFormat);
272  multipleAggregator->Set7dFormat (m_7dFormat);
273  multipleAggregator->Set8dFormat (m_8dFormat);
274  multipleAggregator->Set9dFormat (m_9dFormat);
275  multipleAggregator->Set10dFormat (m_10dFormat);
276 
277  // Set the heading
278  multipleAggregator->SetHeading (m_heading);
279 
280  // Enable logging of data for the file aggregator.
281  multipleAggregator->Enable ();
282 
283  // Add this file aggregator to the map so that it can be used.
284  m_aggregatorMap[aggregatorName] = multipleAggregator;
285 }
286 
288 FileHelper::GetProbe (std::string probeName) const
289 {
290  NS_LOG_FUNCTION (this << probeName);
291 
292  // Look for the probe.
293  std::map<std::string, std::pair <Ptr<Probe>, std::string> >::const_iterator mapIterator = m_probeMap.find (probeName);
294 
295  // Return the probe if it has been added.
296  if (mapIterator != m_probeMap.end ())
297  {
298  return mapIterator->second.first;
299  }
300  else
301  {
302  NS_ABORT_MSG ("That probe has not been added");
303  }
304 }
305 
308 {
309  NS_LOG_FUNCTION (this);
310 
311  // Do a lazy construction of the single aggregator if it hasn't
312  // already been constructed.
313  if (!m_aggregator)
314  {
315  // Create the aggregator.
316  std::string outputFileName = m_outputFileNameWithoutExtension + ".txt";
317  m_aggregator = CreateObject<FileAggregator> (outputFileName, m_fileType);
318 
319  // Set all of the format strings for the aggregator.
320  m_aggregator->Set1dFormat (m_1dFormat);
321  m_aggregator->Set2dFormat (m_2dFormat);
322  m_aggregator->Set3dFormat (m_3dFormat);
323  m_aggregator->Set4dFormat (m_4dFormat);
324  m_aggregator->Set5dFormat (m_5dFormat);
325  m_aggregator->Set6dFormat (m_6dFormat);
326  m_aggregator->Set7dFormat (m_7dFormat);
327  m_aggregator->Set8dFormat (m_8dFormat);
328  m_aggregator->Set9dFormat (m_9dFormat);
329  m_aggregator->Set10dFormat (m_10dFormat);
330 
331  // Set the heading
332  m_aggregator->SetHeading (m_heading);
333 
334  // Enable logging of data for the aggregator.
335  m_aggregator->Enable ();
336  }
337  return m_aggregator;
338 }
339 
341 FileHelper::GetAggregatorMultiple (const std::string &aggregatorName,
342  const std::string &outputFileName)
343 {
344  NS_LOG_FUNCTION (this);
345 
346  // See if this file aggregator had already been added.
347  if (m_aggregatorMap.count (aggregatorName) > 0)
348  {
349  return m_aggregatorMap[aggregatorName];
350  }
351 
352  // Do a lazy construction of the aggregator if it hasn't already
353  // been constructed.
354  bool onlyOneAggregator = false;
355  AddAggregator (aggregatorName,
356  outputFileName,
357  onlyOneAggregator);
358 
359  return m_aggregatorMap[aggregatorName];
360 }
361 
362 void
363 FileHelper::SetHeading (const std::string &heading)
364 {
365  NS_LOG_FUNCTION (this << heading);
366 
367  m_hasHeadingBeenSet = true;
368  m_heading = heading;
369 }
370 
371 void
372 FileHelper::Set1dFormat (const std::string &format)
373 {
374  NS_LOG_FUNCTION (this << format);
375 
376  m_1dFormat = format;
377 }
378 
379 void
380 FileHelper::Set2dFormat (const std::string &format)
381 {
382  NS_LOG_FUNCTION (this << format);
383 
384  m_2dFormat = format;
385 }
386 
387 void
388 FileHelper::Set3dFormat (const std::string &format)
389 {
390  NS_LOG_FUNCTION (this << format);
391 
392  m_3dFormat = format;
393 }
394 
395 void
396 FileHelper::Set4dFormat (const std::string &format)
397 {
398  NS_LOG_FUNCTION (this << format);
399 
400  m_4dFormat = format;
401 }
402 
403 void
404 FileHelper::Set5dFormat (const std::string &format)
405 {
406  NS_LOG_FUNCTION (this << format);
407 
408  m_5dFormat = format;
409 }
410 
411 void
412 FileHelper::Set6dFormat (const std::string &format)
413 {
414  NS_LOG_FUNCTION (this << format);
415 
416  m_6dFormat = format;
417 }
418 
419 void
420 FileHelper::Set7dFormat (const std::string &format)
421 {
422  NS_LOG_FUNCTION (this << format);
423 
424  m_7dFormat = format;
425 }
426 
427 void
428 FileHelper::Set8dFormat (const std::string &format)
429 {
430  NS_LOG_FUNCTION (this << format);
431 
432  m_8dFormat = format;
433 }
434 
435 void
436 FileHelper::Set9dFormat (const std::string &format)
437 {
438  NS_LOG_FUNCTION (this << format);
439 
440  m_9dFormat = format;
441 }
442 
443 void
444 FileHelper::Set10dFormat (const std::string &format)
445 {
446  NS_LOG_FUNCTION (this << format);
447 
448  m_10dFormat = format;
449 }
450 
451 void
452 FileHelper::ConnectProbeToAggregator (const std::string &typeId,
453  const std::string &matchIdentifier,
454  const std::string &path,
455  const std::string &probeTraceSource,
456  const std::string &outputFileNameWithoutExtension,
457  bool onlyOneAggregator)
458 {
459  NS_LOG_FUNCTION (this << typeId << matchIdentifier << path << probeTraceSource
460  << outputFileNameWithoutExtension << onlyOneAggregator);
461 
462  // Increment the total number of file probes that have been created.
464 
465  // Create a unique name for this probe.
466  std::ostringstream probeNameStream;
467  probeNameStream << "FileProbe-" << m_fileProbeCount;
468  std::string probeName = probeNameStream.str ();
469 
470  // Create a unique dataset context string for this probe.
471  std::string probeContext = probeName
472  + "/" + matchIdentifier + "/" + probeTraceSource;
473 
474  // Add the probe to the map of probes, which will keep the probe in
475  // memory after this function ends.
476  AddProbe (typeId, probeName, path);
477 
478  // Because the callbacks to the probes' trace sources don't use the
479  // probe's context, a unique adaptor needs to be created for each
480  // probe context so that information is not lost.
481  AddTimeSeriesAdaptor (probeContext);
482 
483  // Connect the probe to the adaptor.
484  if (m_probeMap[probeName].second == "ns3::DoubleProbe")
485  {
486  m_probeMap[probeName].first->TraceConnectWithoutContext
487  (probeTraceSource,
489  m_timeSeriesAdaptorMap[probeContext]));
490  }
491  else if (m_probeMap[probeName].second == "ns3::BooleanProbe")
492  {
493  m_probeMap[probeName].first->TraceConnectWithoutContext
494  (probeTraceSource,
496  m_timeSeriesAdaptorMap[probeContext]));
497  }
498  else if (m_probeMap[probeName].second == "ns3::PacketProbe")
499  {
500  m_probeMap[probeName].first->TraceConnectWithoutContext
501  (probeTraceSource,
503  m_timeSeriesAdaptorMap[probeContext]));
504  }
505  else if (m_probeMap[probeName].second == "ns3::ApplicationPacketProbe")
506  {
507  m_probeMap[probeName].first->TraceConnectWithoutContext
508  (probeTraceSource,
510  m_timeSeriesAdaptorMap[probeContext]));
511  }
512  else if (m_probeMap[probeName].second == "ns3::Ipv4PacketProbe")
513  {
514  m_probeMap[probeName].first->TraceConnectWithoutContext
515  (probeTraceSource,
517  m_timeSeriesAdaptorMap[probeContext]));
518  }
519  else if (m_probeMap[probeName].second == "ns3::Ipv6PacketProbe")
520  {
521  m_probeMap[probeName].first->TraceConnectWithoutContext
522  (probeTraceSource,
524  m_timeSeriesAdaptorMap[probeContext]));
525  }
526  else if (m_probeMap[probeName].second == "ns3::Uinteger8Probe")
527  {
528  m_probeMap[probeName].first->TraceConnectWithoutContext
529  (probeTraceSource,
531  m_timeSeriesAdaptorMap[probeContext]));
532  }
533  else if (m_probeMap[probeName].second == "ns3::Uinteger16Probe")
534  {
535  m_probeMap[probeName].first->TraceConnectWithoutContext
536  (probeTraceSource,
538  m_timeSeriesAdaptorMap[probeContext]));
539  }
540  else if (m_probeMap[probeName].second == "ns3::Uinteger32Probe")
541  {
542  m_probeMap[probeName].first->TraceConnectWithoutContext
543  (probeTraceSource,
545  m_timeSeriesAdaptorMap[probeContext]));
546  }
547  else
548  {
549  NS_FATAL_ERROR ("Unknown probe type " << m_probeMap[probeName].second << "; need to add support in the helper for this");
550  }
551 
552  // Add the aggregator to the map of aggregators, which will keep the
553  // aggregator in memory after this function ends.
554  std::string outputFileName = outputFileNameWithoutExtension + ".txt";
555  AddAggregator (probeContext, outputFileName, onlyOneAggregator);
556 
557  // Connect the adaptor to the aggregator.
558  std::string adaptorTraceSource = "Output";
559  m_timeSeriesAdaptorMap[probeContext]->TraceConnect
560  (adaptorTraceSource,
561  probeContext,
563  m_aggregatorMap[probeContext]));
564 }
565 
566 } // namespace ns3
567 
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:345
std::string m_3dFormat
Format string for 3D format C-style sprintf() function.
Definition: file-helper.h:310
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
std::string m_6dFormat
Format string for 6D format C-style sprintf() function.
Definition: file-helper.h:313
std::string m_9dFormat
Format string for 9D format C-style sprintf() function.
Definition: file-helper.h:316
void Set4dFormat(const std::string &format)
Sets the 4D format string for the C-style sprintf() function.
Definition: file-helper.cc:396
std::string m_4dFormat
Format string for 4D format C-style sprintf() function.
Definition: file-helper.h:311
Ptr< FileAggregator > m_aggregator
The single aggregator that is always created in the constructor.
Definition: file-helper.h:281
void Set8dFormat(const std::string &format)
Sets the 8D format string for the C-style sprintf() function.
Definition: file-helper.cc:428
void SetTypeId(TypeId tid)
std::string GetMatchedPath(uint32_t i) const
Definition: config.cc:75
void Set6dFormat(const std::string &format)
Sets the 6D format string for the C-style sprintf() function.
Definition: file-helper.cc:412
void Set5dFormat(const std::string &format)
Sets the 5D format string for the C-style sprintf() function.
Definition: file-helper.cc:404
void Set10dFormat(const std::string &format)
Sets the 10D format string for the C-style sprintf() function.
Definition: file-helper.cc:444
#define NS_FATAL_ERROR(msg)
fatal error handling
Definition: fatal-error.h:72
std::string m_7dFormat
Format string for 7D format C-style sprintf() function.
Definition: file-helper.h:314
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:181
This aggregator sends values it receives to a file.
Config::MatchContainer LookupMatches(std::string path)
Definition: config.cc:739
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:238
void Write2d(std::string context, double v1, double v2)
Writes 2 values to the file.
Ptr< Probe > GetProbe(std::string probeName) const
Gets the specified probe.
Definition: file-helper.cc:288
void Set9dFormat(const std::string &format)
Sets the 9D format string for the C-style sprintf() function.
Definition: file-helper.cc:436
Ptr< Object > Create(void) const
uint32_t m_fileProbeCount
Number of file probes that have been created.
Definition: file-helper.h:294
std::string m_10dFormat
Format string for 10D format C-style sprintf() function.
Definition: file-helper.h:317
std::string m_8dFormat
Format string for 8D format C-style sprintf() function.
Definition: file-helper.h:315
FileType
The type of file written by the aggregator.
FileHelper()
Constructs a file helper that will create a space separated file named "file-helper.txt" unless it is later configured otherwise.
Definition: file-helper.cc:36
std::string m_heading
Heading line for the outputfile.
Definition: file-helper.h:306
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1238
Ptr< FileAggregator > GetAggregatorSingle()
Gets the single aggregator that is always constructed.
Definition: file-helper.cc:307
void TraceSinkUinteger32(uint32_t oldData, uint32_t newData)
Trace sink for receiving data from uint32_t valued trace sources.
void AddTimeSeriesAdaptor(const std::string &adaptorName)
Adds a time series adaptor to be used to write the file.
Definition: file-helper.cc:217
uint32_t GetN(void) const
Definition: config.cc:63
ObjectFactory m_factory
Used to create the probes and collectors as they are added.
Definition: file-helper.h:278
void Set7dFormat(const std::string &format)
Sets the 7D format string for the C-style sprintf() function.
Definition: file-helper.cc:420
std::map< std::string, std::pair< Ptr< Probe >, std::string > > m_probeMap
Maps probe names to probes.
Definition: file-helper.h:288
virtual ~FileHelper()
Definition: file-helper.cc:63
std::map< std::string, Ptr< FileAggregator > > m_aggregatorMap
Maps aggregator names to aggregators when multiple aggregators are needed.
Definition: file-helper.h:285
void TraceSinkUinteger8(uint8_t oldData, uint8_t newData)
Trace sink for receiving data from uint8_t valued trace sources.
enum FileAggregator::FileType m_fileType
Determines the kind of file written by the aggregator.
Definition: file-helper.h:297
Ptr< FileAggregator > GetAggregatorMultiple(const std::string &aggregatorName, const std::string &outputFileName)
Gets one of the multiple aggregators from the map.
Definition: file-helper.cc:341
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:363
void ConfigureFile(const std::string &outputFileNameWithoutExtension, enum FileAggregator::FileType fileType=FileAggregator::SPACE_SEPARATED)
Definition: file-helper.cc:69
void Set1dFormat(const std::string &format)
Sets the 1D format string for the C-style sprintf() function.
Definition: file-helper.cc:372
std::string m_1dFormat
Format string for 1D format C-style sprintf() function.
Definition: file-helper.h:308
hold a set of objects which match a specific search string.
Definition: config.h:127
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:452
std::string m_2dFormat
Format string for 2D format C-style sprintf() function.
Definition: file-helper.h:309
#define NS_ABORT_MSG(msg)
Abnormal program termination.
Definition: abort.h:43
void Set3dFormat(const std::string &format)
Sets the 3D format string for the C-style sprintf() function.
Definition: file-helper.cc:388
#define NS_LOG_WARN(msg)
Definition: log.h:280
bool m_hasHeadingBeenSet
Indicates if the heading line for the file has been set.
Definition: file-helper.h:303
std::string m_5dFormat
Format string for 5D format C-style sprintf() function.
Definition: file-helper.h:312
std::map< std::string, Ptr< TimeSeriesAdaptor > > m_timeSeriesAdaptorMap
Maps time series adaptor names to time series adaptors.
Definition: file-helper.h:291
void TraceSinkUinteger16(uint16_t oldData, uint16_t newData)
Trace sink for receiving data from uint16_t valued trace sources.
void WriteProbe(const std::string &typeId, const std::string &path, const std::string &probeTraceSource)
Definition: file-helper.cc:91
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.
Ptr< T > GetObject(void) const
Definition: object.h:361
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...
Base class for probes.
Definition: probe.h:39
std::string m_outputFileNameWithoutExtension
The name of the output file to created without its extension.
Definition: file-helper.h:300
void Set2dFormat(const std::string &format)
Sets the 2D format string for the C-style sprintf() function.
Definition: file-helper.cc:380