A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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
31namespace ns3
32{
33
34NS_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
49FileHelper::FileHelper(const std::string& outputFileNameWithoutExtension,
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
68void
69FileHelper::ConfigureFile(const std::string& outputFileNameWithoutExtension,
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
90void
91FileHelper::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
178void
179FileHelper::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.
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
214void
215FileHelper::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
235void
236FileHelper::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
286FileHelper::GetProbe(std::string probeName) const
287{
288 NS_LOG_FUNCTION(this << probeName);
289
290 // Look for the probe.
291 std::map<std::string, std::pair<Ptr<Probe>, std::string>>::const_iterator mapIterator =
292 m_probeMap.find(probeName);
293
294 // Return the probe if it has been added.
295 if (mapIterator != m_probeMap.end())
296 {
297 return mapIterator->second.first;
298 }
299 else
300 {
301 NS_ABORT_MSG("That probe has not been added");
302 }
303}
304
307{
308 NS_LOG_FUNCTION(this);
309
310 // Do a lazy construction of the single aggregator if it hasn't
311 // already been constructed.
312 if (!m_aggregator)
313 {
314 // Create the aggregator.
315 std::string outputFileName = m_outputFileNameWithoutExtension + ".txt";
316 m_aggregator = CreateObject<FileAggregator>(outputFileName, m_fileType);
317
318 // Set all of the format strings for the aggregator.
319 m_aggregator->Set1dFormat(m_1dFormat);
320 m_aggregator->Set2dFormat(m_2dFormat);
321 m_aggregator->Set3dFormat(m_3dFormat);
322 m_aggregator->Set4dFormat(m_4dFormat);
323 m_aggregator->Set5dFormat(m_5dFormat);
324 m_aggregator->Set6dFormat(m_6dFormat);
325 m_aggregator->Set7dFormat(m_7dFormat);
326 m_aggregator->Set8dFormat(m_8dFormat);
327 m_aggregator->Set9dFormat(m_9dFormat);
328 m_aggregator->Set10dFormat(m_10dFormat);
329
330 // Set the heading
331 m_aggregator->SetHeading(m_heading);
332
333 // Enable logging of data for the aggregator.
334 m_aggregator->Enable();
335 }
336 return m_aggregator;
337}
338
340FileHelper::GetAggregatorMultiple(const std::string& aggregatorName,
341 const std::string& outputFileName)
342{
343 NS_LOG_FUNCTION(this);
344
345 // See if this file aggregator had already been added.
346 if (m_aggregatorMap.count(aggregatorName) > 0)
347 {
348 return m_aggregatorMap[aggregatorName];
349 }
350
351 // Do a lazy construction of the aggregator if it hasn't already
352 // been constructed.
353 bool onlyOneAggregator = false;
354 AddAggregator(aggregatorName, outputFileName, onlyOneAggregator);
355
356 return m_aggregatorMap[aggregatorName];
357}
358
359void
360FileHelper::SetHeading(const std::string& heading)
361{
362 NS_LOG_FUNCTION(this << heading);
363
364 m_hasHeadingBeenSet = true;
365 m_heading = heading;
366}
367
368void
369FileHelper::Set1dFormat(const std::string& format)
370{
371 NS_LOG_FUNCTION(this << format);
372
373 m_1dFormat = format;
374}
375
376void
377FileHelper::Set2dFormat(const std::string& format)
378{
379 NS_LOG_FUNCTION(this << format);
380
381 m_2dFormat = format;
382}
383
384void
385FileHelper::Set3dFormat(const std::string& format)
386{
387 NS_LOG_FUNCTION(this << format);
388
389 m_3dFormat = format;
390}
391
392void
393FileHelper::Set4dFormat(const std::string& format)
394{
395 NS_LOG_FUNCTION(this << format);
396
397 m_4dFormat = format;
398}
399
400void
401FileHelper::Set5dFormat(const std::string& format)
402{
403 NS_LOG_FUNCTION(this << format);
404
405 m_5dFormat = format;
406}
407
408void
409FileHelper::Set6dFormat(const std::string& format)
410{
411 NS_LOG_FUNCTION(this << format);
412
413 m_6dFormat = format;
414}
415
416void
417FileHelper::Set7dFormat(const std::string& format)
418{
419 NS_LOG_FUNCTION(this << format);
420
421 m_7dFormat = format;
422}
423
424void
425FileHelper::Set8dFormat(const std::string& format)
426{
427 NS_LOG_FUNCTION(this << format);
428
429 m_8dFormat = format;
430}
431
432void
433FileHelper::Set9dFormat(const std::string& format)
434{
435 NS_LOG_FUNCTION(this << format);
436
437 m_9dFormat = format;
438}
439
440void
441FileHelper::Set10dFormat(const std::string& format)
442{
443 NS_LOG_FUNCTION(this << format);
444
445 m_10dFormat = format;
446}
447
448void
449FileHelper::ConnectProbeToAggregator(const std::string& typeId,
450 const std::string& matchIdentifier,
451 const std::string& path,
452 const std::string& probeTraceSource,
453 const std::string& outputFileNameWithoutExtension,
454 bool onlyOneAggregator)
455{
456 NS_LOG_FUNCTION(this << typeId << matchIdentifier << path << probeTraceSource
457 << outputFileNameWithoutExtension << onlyOneAggregator);
458
459 // Increment the total number of file probes that have been created.
461
462 // Create a unique name for this probe.
463 std::ostringstream probeNameStream;
464 probeNameStream << "FileProbe-" << m_fileProbeCount;
465 std::string probeName = probeNameStream.str();
466
467 // Create a unique dataset context string for this probe.
468 std::string probeContext = probeName + "/" + matchIdentifier + "/" + probeTraceSource;
469
470 // Add the probe to the map of probes, which will keep the probe in
471 // memory after this function ends.
472 AddProbe(typeId, probeName, path);
473
474 // Because the callbacks to the probes' trace sources don't use the
475 // probe's context, a unique adaptor needs to be created for each
476 // probe context so that information is not lost.
477 AddTimeSeriesAdaptor(probeContext);
478
479 // Connect the probe to the adaptor.
480 if (m_probeMap[probeName].second == "ns3::DoubleProbe")
481 {
482 m_probeMap[probeName].first->TraceConnectWithoutContext(
483 probeTraceSource,
485 m_timeSeriesAdaptorMap[probeContext]));
486 }
487 else if (m_probeMap[probeName].second == "ns3::BooleanProbe")
488 {
489 m_probeMap[probeName].first->TraceConnectWithoutContext(
490 probeTraceSource,
492 m_timeSeriesAdaptorMap[probeContext]));
493 }
494 else if (m_probeMap[probeName].second == "ns3::PacketProbe")
495 {
496 m_probeMap[probeName].first->TraceConnectWithoutContext(
497 probeTraceSource,
499 m_timeSeriesAdaptorMap[probeContext]));
500 }
501 else if (m_probeMap[probeName].second == "ns3::ApplicationPacketProbe")
502 {
503 m_probeMap[probeName].first->TraceConnectWithoutContext(
504 probeTraceSource,
506 m_timeSeriesAdaptorMap[probeContext]));
507 }
508 else if (m_probeMap[probeName].second == "ns3::Ipv4PacketProbe")
509 {
510 m_probeMap[probeName].first->TraceConnectWithoutContext(
511 probeTraceSource,
513 m_timeSeriesAdaptorMap[probeContext]));
514 }
515 else if (m_probeMap[probeName].second == "ns3::Ipv6PacketProbe")
516 {
517 m_probeMap[probeName].first->TraceConnectWithoutContext(
518 probeTraceSource,
520 m_timeSeriesAdaptorMap[probeContext]));
521 }
522 else if (m_probeMap[probeName].second == "ns3::Uinteger8Probe")
523 {
524 m_probeMap[probeName].first->TraceConnectWithoutContext(
525 probeTraceSource,
527 m_timeSeriesAdaptorMap[probeContext]));
528 }
529 else if (m_probeMap[probeName].second == "ns3::Uinteger16Probe")
530 {
531 m_probeMap[probeName].first->TraceConnectWithoutContext(
532 probeTraceSource,
534 m_timeSeriesAdaptorMap[probeContext]));
535 }
536 else if (m_probeMap[probeName].second == "ns3::Uinteger32Probe")
537 {
538 m_probeMap[probeName].first->TraceConnectWithoutContext(
539 probeTraceSource,
541 m_timeSeriesAdaptorMap[probeContext]));
542 }
543 else if (m_probeMap[probeName].second == "ns3::TimeProbe")
544 {
545 m_probeMap[probeName].first->TraceConnectWithoutContext(
546 probeTraceSource,
548 m_timeSeriesAdaptorMap[probeContext]));
549 }
550 else
551 {
552 NS_FATAL_ERROR("Unknown probe type " << m_probeMap[probeName].second
553 << "; need to add support in the helper for this");
554 }
555
556 // Add the aggregator to the map of aggregators, which will keep the
557 // aggregator in memory after this function ends.
558 std::string outputFileName = outputFileNameWithoutExtension + ".txt";
559 AddAggregator(probeContext, outputFileName, onlyOneAggregator);
560
561 // Connect the adaptor to the aggregator.
562 std::string adaptorTraceSource = "Output";
563 m_timeSeriesAdaptorMap[probeContext]->TraceConnect(
564 adaptorTraceSource,
565 probeContext,
567}
568
569} // 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:377
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:360
void Set5dFormat(const std::string &format)
Sets the 5D format string for the C-style sprintf() function.
Definition: file-helper.cc:401
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:306
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:385
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:409
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:369
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:393
void Set7dFormat(const std::string &format)
Sets the 7D format string for the C-style sprintf() function.
Definition: file-helper.cc:417
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:425
Ptr< FileAggregator > GetAggregatorMultiple(const std::string &aggregatorName, const std::string &outputFileName)
Gets one of the multiple aggregators from the map.
Definition: file-helper.cc:340
void Set10dFormat(const std::string &format)
Sets the 10D format string for the C-style sprintf() function.
Definition: file-helper.cc:441
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:449
void Set9dFormat(const std::string &format)
Sets the 9D format string for the C-style sprintf() function.
Definition: file-helper.cc:433
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:40
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
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:999
#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:702
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