26 #include "ns3/object-factory.h" 28 #include "ns3/probe.h" 29 #include "ns3/file-aggregator.h" 30 #include "ns3/time-series-adaptor.h" 57 FileHelper (
const std::string &outputFileNameWithoutExtension,
73 void ConfigureFile (
const std::string &outputFileNameWithoutExtension,
107 const std::string &path,
108 const std::string &probeTraceSource);
126 const std::string &outputFileName,
127 bool onlyOneAggregator);
155 const std::string &outputFileName);
256 void AddProbe (
const std::string &typeId,
257 const std::string &probeName,
258 const std::string &path);
276 const std::string &matchIdentifier,
277 const std::string &path,
278 const std::string &probeTraceSource,
279 const std::string &outputFileNameWithoutExtension,
280 bool onlyOneAggregator);
293 std::map<std::string, std::pair <Ptr<Probe>, std::string> >
m_probeMap;
329 #endif // FILE_HELPER_H Smart pointer class similar to boost::intrusive_ptr.
std::string m_3dFormat
Format string for 3D format C-style sprintf() function.
std::string m_6dFormat
Format string for 6D format C-style sprintf() function.
std::string m_9dFormat
Format string for 9D format C-style sprintf() function.
void Set4dFormat(const std::string &format)
Sets the 4D format string for the C-style sprintf() function.
std::string m_4dFormat
Format string for 4D format C-style sprintf() function.
Ptr< FileAggregator > m_aggregator
The single aggregator that is always created in the constructor.
void Set8dFormat(const std::string &format)
Sets the 8D format string for the C-style sprintf() function.
void Set6dFormat(const std::string &format)
Sets the 6D format string for the C-style sprintf() function.
void Set5dFormat(const std::string &format)
Sets the 5D format string for the C-style sprintf() function.
void Set10dFormat(const std::string &format)
Sets the 10D format string for the C-style sprintf() function.
std::string m_7dFormat
Format string for 7D format C-style sprintf() function.
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.
void AddAggregator(const std::string &aggregatorName, const std::string &outputFileName, bool onlyOneAggregator)
Adds an aggregator to be used to write values to files.
void Set9dFormat(const std::string &format)
Sets the 9D format string for the C-style sprintf() function.
uint32_t m_fileProbeCount
Number of file probes that have been created.
std::string m_10dFormat
Format string for 10D format C-style sprintf() function.
std::string m_8dFormat
Format string for 8D format C-style sprintf() function.
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.
std::string m_heading
Heading line for the outputfile.
Ptr< FileAggregator > GetAggregatorSingle()
Gets the single aggregator that is always constructed.
Helper class used to put data values into a file.
void AddTimeSeriesAdaptor(const std::string &adaptorName)
Adds a time series adaptor to be used to write the file.
ObjectFactory m_factory
Used to create the probes and collectors as they are added.
void Set7dFormat(const std::string &format)
Sets the 7D format string for the C-style sprintf() function.
std::map< std::string, std::pair< Ptr< Probe >, std::string > > m_probeMap
Maps probe names to probes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< std::string, Ptr< FileAggregator > > m_aggregatorMap
Maps aggregator names to aggregators when multiple aggregators are needed.
enum FileAggregator::FileType m_fileType
Determines the kind of file written by the aggregator.
Ptr< FileAggregator > GetAggregatorMultiple(const std::string &aggregatorName, const std::string &outputFileName)
Gets one of the multiple aggregators from the map.
void SetHeading(const std::string &heading)
Sets the heading string that will be printed on the first line of the file.
Ptr< Probe > GetProbe(std::string probeName) const
Gets the specified probe.
void ConfigureFile(const std::string &outputFileNameWithoutExtension, enum FileAggregator::FileType fileType=FileAggregator::SPACE_SEPARATED)
void Set1dFormat(const std::string &format)
Sets the 1D format string for the C-style sprintf() function.
std::string m_1dFormat
Format string for 1D format C-style sprintf() function.
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.
std::string m_2dFormat
Format string for 2D format C-style sprintf() function.
Instantiate subclasses of ns3::Object.
void Set3dFormat(const std::string &format)
Sets the 3D format string for the C-style sprintf() function.
bool m_hasHeadingBeenSet
Indicates if the heading line for the file has been set.
std::string m_5dFormat
Format string for 5D format C-style sprintf() function.
std::map< std::string, Ptr< TimeSeriesAdaptor > > m_timeSeriesAdaptorMap
Maps time series adaptor names to time series adaptors.
void WriteProbe(const std::string &typeId, const std::string &path, const std::string &probeTraceSource)
std::string m_outputFileNameWithoutExtension
The name of the output file to created without its extension.
void Set2dFormat(const std::string &format)
Sets the 2D format string for the C-style sprintf() function.