Class for output file stream container for long double values. More...
#include "satellite-output-fstream-long-double-container.h"
Public Types | |
enum | FigureUnitConversion_t { RAW , DECIBEL , DECIBEL_AMPLITUDE } |
Public Member Functions | |
SatOutputFileStreamLongDoubleContainer () | |
Constructor. More... | |
SatOutputFileStreamLongDoubleContainer (std::string filename, std::ios::openmode filemode, uint32_t valuesInRow) | |
Constructor. More... | |
~SatOutputFileStreamLongDoubleContainer () | |
Destructor. More... | |
void | AddToContainer (std::vector< long double > newItem) |
Function for adding the values to container. More... | |
void | DoDispose () |
Do needed dispose actions. More... | |
void | EnableFigureOutput (std::string title, std::string legendY, std::string legendX, std::string keyPosition, FigureUnitConversion_t figureUnitConversionType) |
Function for enabling the figure output. More... | |
void | WriteContainerToFile () |
Function for writing the container contents to file. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
NS-3 function for type id. More... | |
Private Member Functions | |
void | ClearContainer () |
Function for clearing the container. More... | |
long double | ConvertValue (long double value) |
Function for converting the container data samples. More... | |
Gnuplot | GetGnuplot () |
Function for creating Gnuplots. More... | |
Gnuplot2dDataset | GetGnuplotDataset () |
Function for creating Gnuplot datasets. More... | |
void | OpenStream () |
Function for opening the output file stream. More... | |
void | PrintFigure () |
Function for printing the container contents into a figure. More... | |
void | Reset () |
Function for resetting the variables. More... | |
void | ResetStream () |
Function for resetting the stream. More... | |
Private Attributes | |
std::vector< std::vector< long double > > | m_container |
Container for value rows. More... | |
FigureUnitConversion_t | m_figureUnitConversionType |
Describes which unit conversion should be used with the figure. More... | |
std::ios::openmode | m_fileMode |
File mode. More... | |
std::string | m_fileName |
File name. More... | |
std::string | m_keyPosition |
Figure legend position. More... | |
std::string | m_legendX |
Figure X-axis title. More... | |
std::string | m_legendY |
Figure Y-axis title. More... | |
std::ofstream * | m_outputFileStream |
Pointer to output file stream. More... | |
SatOutputFileStreamWrapper * | m_outputFileStreamWrapper |
Pointer to output file stream wrapper. More... | |
bool | m_printFigure |
Enable / disable printing of container contents into a figure. More... | |
std::string | m_title |
Figure title. More... | |
uint32_t | m_valuesInRow |
Number of values in a row. More... | |
Class for output file stream container for long double values.
The class implements storing the values and writing the stored values into a file. A figure output in two dimensions is also supported.
Definition at line 42 of file satellite-output-fstream-long-double-container.h.
Enumerator | |
---|---|
RAW | |
DECIBEL | |
DECIBEL_AMPLITUDE |
Definition at line 45 of file satellite-output-fstream-long-double-container.h.
ns3::SatOutputFileStreamLongDoubleContainer::SatOutputFileStreamLongDoubleContainer | ( | std::string | filename, |
std::ios::openmode | filemode, | ||
uint32_t | valuesInRow | ||
) |
Constructor.
filename | file name |
filemode | file mode |
valuesInRow | number of values in a row |
Definition at line 41 of file satellite-output-fstream-long-double-container.cc.
References m_fileMode, m_fileName, and m_valuesInRow.
ns3::SatOutputFileStreamLongDoubleContainer::SatOutputFileStreamLongDoubleContainer | ( | ) |
Constructor.
Definition at line 63 of file satellite-output-fstream-long-double-container.cc.
ns3::SatOutputFileStreamLongDoubleContainer::~SatOutputFileStreamLongDoubleContainer | ( | ) |
Destructor.
Definition at line 78 of file satellite-output-fstream-long-double-container.cc.
References Reset().
void ns3::SatOutputFileStreamLongDoubleContainer::AddToContainer | ( | std::vector< long double > | newItem | ) |
Function for adding the values to container.
Definition at line 159 of file satellite-output-fstream-long-double-container.cc.
References m_container, and m_valuesInRow.
|
private |
Function for clearing the container.
Definition at line 207 of file satellite-output-fstream-long-double-container.cc.
References m_container, and m_valuesInRow.
Referenced by Reset().
|
private |
Function for converting the container data samples.
value | original data sample value |
Definition at line 257 of file satellite-output-fstream-long-double-container.cc.
References DECIBEL, DECIBEL_AMPLITUDE, m_figureUnitConversionType, and RAW.
Referenced by GetGnuplotDataset().
void ns3::SatOutputFileStreamLongDoubleContainer::DoDispose | ( | void | ) |
Do needed dispose actions.
Definition at line 86 of file satellite-output-fstream-long-double-container.cc.
References Reset().
void ns3::SatOutputFileStreamLongDoubleContainer::EnableFigureOutput | ( | std::string | title, |
std::string | legendY, | ||
std::string | legendX, | ||
std::string | keyPosition, | ||
FigureUnitConversion_t | figureUnitConversionType | ||
) |
Function for enabling the figure output.
title | title text |
legendY | Y-axis title |
legendX | X-axis title |
keyPosition | Legend position |
figureUnitConversionType | Conversion type for units in the figure |
Definition at line 304 of file satellite-output-fstream-long-double-container.cc.
References m_figureUnitConversionType, m_keyPosition, m_legendX, m_legendY, m_printFigure, and m_title.
|
private |
Function for creating Gnuplots.
Definition at line 290 of file satellite-output-fstream-long-double-container.cc.
References m_fileName, m_keyPosition, m_legendX, m_legendY, and m_title.
Referenced by PrintFigure().
|
private |
Function for creating Gnuplot datasets.
Definition at line 227 of file satellite-output-fstream-long-double-container.cc.
References ConvertValue(), m_container, m_title, and m_valuesInRow.
Referenced by PrintFigure().
|
static |
NS-3 function for type id.
Definition at line 33 of file satellite-output-fstream-long-double-container.cc.
|
private |
Function for opening the output file stream.
Definition at line 173 of file satellite-output-fstream-long-double-container.cc.
References ns3::SatOutputFileStreamWrapper::GetStream(), m_fileMode, m_fileName, m_outputFileStream, and m_outputFileStreamWrapper.
Referenced by WriteContainerToFile().
|
private |
Function for printing the container contents into a figure.
Definition at line 134 of file satellite-output-fstream-long-double-container.cc.
References GetGnuplot(), GetGnuplotDataset(), and m_fileName.
Referenced by WriteContainerToFile().
|
private |
Function for resetting the variables.
Definition at line 182 of file satellite-output-fstream-long-double-container.cc.
References ClearContainer(), and ResetStream().
Referenced by ~SatOutputFileStreamLongDoubleContainer(), DoDispose(), and WriteContainerToFile().
|
private |
Function for resetting the stream.
Definition at line 191 of file satellite-output-fstream-long-double-container.cc.
References m_fileMode, m_fileName, m_outputFileStream, and m_outputFileStreamWrapper.
Referenced by Reset().
void ns3::SatOutputFileStreamLongDoubleContainer::WriteContainerToFile | ( | ) |
Function for writing the container contents to file.
Definition at line 95 of file satellite-output-fstream-long-double-container.cc.
References m_container, m_outputFileStream, m_printFigure, m_valuesInRow, OpenStream(), PrintFigure(), and Reset().
|
private |
Container for value rows.
Definition at line 165 of file satellite-output-fstream-long-double-container.h.
Referenced by AddToContainer(), ClearContainer(), GetGnuplotDataset(), and WriteContainerToFile().
|
private |
Describes which unit conversion should be used with the figure.
Definition at line 210 of file satellite-output-fstream-long-double-container.h.
Referenced by ConvertValue(), and EnableFigureOutput().
|
private |
File mode.
Definition at line 175 of file satellite-output-fstream-long-double-container.h.
Referenced by SatOutputFileStreamLongDoubleContainer(), OpenStream(), and ResetStream().
|
private |
File name.
Definition at line 170 of file satellite-output-fstream-long-double-container.h.
Referenced by SatOutputFileStreamLongDoubleContainer(), GetGnuplot(), OpenStream(), PrintFigure(), and ResetStream().
|
private |
Figure legend position.
Definition at line 205 of file satellite-output-fstream-long-double-container.h.
Referenced by EnableFigureOutput(), and GetGnuplot().
|
private |
Figure X-axis title.
Definition at line 200 of file satellite-output-fstream-long-double-container.h.
Referenced by EnableFigureOutput(), and GetGnuplot().
|
private |
Figure Y-axis title.
Definition at line 195 of file satellite-output-fstream-long-double-container.h.
Referenced by EnableFigureOutput(), and GetGnuplot().
|
private |
Pointer to output file stream.
Definition at line 160 of file satellite-output-fstream-long-double-container.h.
Referenced by OpenStream(), ResetStream(), and WriteContainerToFile().
|
private |
Pointer to output file stream wrapper.
Definition at line 155 of file satellite-output-fstream-long-double-container.h.
Referenced by OpenStream(), and ResetStream().
|
private |
Enable / disable printing of container contents into a figure.
Definition at line 185 of file satellite-output-fstream-long-double-container.h.
Referenced by EnableFigureOutput(), and WriteContainerToFile().
|
private |
Figure title.
Definition at line 190 of file satellite-output-fstream-long-double-container.h.
Referenced by EnableFigureOutput(), GetGnuplot(), and GetGnuplotDataset().
|
private |
Number of values in a row.
Definition at line 180 of file satellite-output-fstream-long-double-container.h.
Referenced by SatOutputFileStreamLongDoubleContainer(), AddToContainer(), ClearContainer(), GetGnuplotDataset(), and WriteContainerToFile().