A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::GnuplotCollection Class Reference

a simple class to group together multiple gnuplots into one file, e.g. More...

#include "gnuplot.h"

+ Collaboration diagram for ns3::GnuplotCollection:

Public Member Functions

 GnuplotCollection (const std::string &outputFilename)
 
 GnuplotCollection (const std::string &outputFilename)
 
void AddPlot (const Gnuplot &plot)
 
void AddPlot (const Gnuplot &plot)
 
void GenerateOutput (std::ostream &os)
 
void GenerateOutput (std::ostream &os)
 
void GenerateOutput (std::ostream &osControl, std::ostream &osData, std::string dataFileName)
 
void GenerateOutput (std::ostream &osControl, std::ostream &osData, std::string dataFileName)
 
GnuplotGetPlot (unsigned int id)
 Return a pointer to one of the added plots.
 
GnuplotGetPlot (unsigned int id)
 Return a pointer to one of the added plots.
 
void SetTerminal (const std::string &terminal)
 
void SetTerminal (const std::string &terminal)
 

Private Types

typedef std::vector< GnuplotPlots
 Type of the Gnuplot collection.
 
typedef std::vector< GnuplotPlots
 Type of the Gnuplot collection.
 

Private Attributes

std::string m_outputFilename
 Output file name.
 
Plots m_plots
 Plots in the collection.
 
std::string m_terminal
 Gnuplot "terminal" to use.
 

Detailed Description

a simple class to group together multiple gnuplots into one file, e.g.

for PDF multi-page output terminals.

Definition at line 473 of file gnuplot.h.

Member Typedef Documentation

◆ Plots [1/2]

Type of the Gnuplot collection.

Definition at line 520 of file gnuplot.h.

◆ Plots [2/2]

Type of the Gnuplot collection.

Definition at line 520 of file gnuplot_new.h.

Constructor & Destructor Documentation

◆ GnuplotCollection() [1/2]

ns3::GnuplotCollection::GnuplotCollection ( const std::string &  outputFilename)
Parameters
outputFilenamethe name of the file where the rendering of the graph will be generated if you feed the command stream output by GnuplotCollection::GenerateOutput to the gnuplot program.

Definition at line 898 of file gnuplot.cc.

◆ GnuplotCollection() [2/2]

ns3::GnuplotCollection::GnuplotCollection ( const std::string &  outputFilename)
Parameters
outputFilenamethe name of the file where the rendering of the graph will be generated if you feed the command stream output by GnuplotCollection::GenerateOutput to the gnuplot program.

Member Function Documentation

◆ AddPlot() [1/2]

void ns3::GnuplotCollection::AddPlot ( const Gnuplot plot)
Parameters
plotadd a plot to the collection to be plotted.

Definition at line 911 of file gnuplot.cc.

References ns3::Create(), and m_plots.

+ Here is the call graph for this function:

◆ AddPlot() [2/2]

void ns3::GnuplotCollection::AddPlot ( const Gnuplot plot)
Parameters
plotadd a plot to the collection to be plotted.

◆ GenerateOutput() [1/4]

void ns3::GnuplotCollection::GenerateOutput ( std::ostream &  os)
Parameters
osthe output stream on which the relevant gnuplot commands should be generated.

Definition at line 930 of file gnuplot.cc.

References ns3::Create(), ns3::Gnuplot::GenerateOutput(), m_outputFilename, m_plots, and m_terminal.

+ Here is the call graph for this function:

◆ GenerateOutput() [2/4]

void ns3::GnuplotCollection::GenerateOutput ( std::ostream &  os)
Parameters
osthe output stream on which the relevant gnuplot commands should be generated.

◆ GenerateOutput() [3/4]

void ns3::GnuplotCollection::GenerateOutput ( std::ostream &  osControl,
std::ostream &  osData,
std::string  dataFileName 
)
Parameters
osControlthe output stream on which the relevant gnuplot control commands should be generated. Including output file and terminal headers.
osDatathe output stream on which the relevant gnuplot data values should be generated.
dataFileNamethe name for the data file that will be written.

Definition at line 952 of file gnuplot.cc.

References ns3::Create(), m_outputFilename, m_plots, and m_terminal.

+ Here is the call graph for this function:

◆ GenerateOutput() [4/4]

void ns3::GnuplotCollection::GenerateOutput ( std::ostream &  osControl,
std::ostream &  osData,
std::string  dataFileName 
)
Parameters
osControlthe output stream on which the relevant gnuplot control commands should be generated. Including output file and terminal headers.
osDatathe output stream on which the relevant gnuplot data values should be generated.
dataFileNamethe name for the data file that will be written.

◆ GetPlot() [1/2]

Gnuplot & ns3::GnuplotCollection::GetPlot ( unsigned int  id)

Return a pointer to one of the added plots.

Parameters
idindex of plot to return
Returns
reference to plot, throws std::range_error if it does not exist.

Definition at line 917 of file gnuplot.cc.

References m_plots.

◆ GetPlot() [2/2]

Gnuplot & ns3::GnuplotCollection::GetPlot ( unsigned int  id)

Return a pointer to one of the added plots.

Parameters
idindex of plot to return
Returns
reference to plot, throws std::range_error if it does not exist.

◆ SetTerminal() [1/2]

void ns3::GnuplotCollection::SetTerminal ( const std::string &  terminal)
Parameters
terminalterminal setting string for output. The default terminal string is guessed from the output filename's extension.

Definition at line 905 of file gnuplot.cc.

References ns3::Create(), and m_terminal.

+ Here is the call graph for this function:

◆ SetTerminal() [2/2]

void ns3::GnuplotCollection::SetTerminal ( const std::string &  terminal)
Parameters
terminalterminal setting string for output. The default terminal string is guessed from the output filename's extension.

Member Data Documentation

◆ m_outputFilename

std::string ns3::GnuplotCollection::m_outputFilename
private

Output file name.

Definition at line 522 of file gnuplot.h.

Referenced by GenerateOutput(), and GenerateOutput().

◆ m_plots

Plots ns3::GnuplotCollection::m_plots
private

Plots in the collection.

Definition at line 525 of file gnuplot.h.

Referenced by AddPlot(), GenerateOutput(), GenerateOutput(), and GetPlot().

◆ m_terminal

std::string ns3::GnuplotCollection::m_terminal
private

Gnuplot "terminal" to use.

Definition at line 523 of file gnuplot.h.

Referenced by GenerateOutput(), GenerateOutput(), and SetTerminal().


The documentation for this class was generated from the following files: