ns3::SatOutputFileStreamLongDoubleContainer Class Reference

Class for output file stream container for long double values. More...

#include "satellite-output-fstream-long-double-container.h"

+ Inheritance diagram for ns3::SatOutputFileStreamLongDoubleContainer:
+ Collaboration diagram for ns3::SatOutputFileStreamLongDoubleContainer:

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...
 
SatOutputFileStreamWrapperm_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...
 

Detailed Description

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 41 of file satellite-output-fstream-long-double-container.h.

Member Enumeration Documentation

◆ FigureUnitConversion_t

Enumerator
RAW 
DECIBEL 
DECIBEL_AMPLITUDE 

Definition at line 44 of file satellite-output-fstream-long-double-container.h.

Constructor & Destructor Documentation

◆ SatOutputFileStreamLongDoubleContainer() [1/2]

ns3::SatOutputFileStreamLongDoubleContainer::SatOutputFileStreamLongDoubleContainer ( std::string  filename,
std::ios::openmode  filemode,
uint32_t  valuesInRow 
)

Constructor.

Parameters
filenamefile name
filemodefile mode
valuesInRownumber 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.

◆ SatOutputFileStreamLongDoubleContainer() [2/2]

ns3::SatOutputFileStreamLongDoubleContainer::SatOutputFileStreamLongDoubleContainer ( )

Constructor.

Definition at line 63 of file satellite-output-fstream-long-double-container.cc.

◆ ~SatOutputFileStreamLongDoubleContainer()

ns3::SatOutputFileStreamLongDoubleContainer::~SatOutputFileStreamLongDoubleContainer ( )

Destructor.

Definition at line 78 of file satellite-output-fstream-long-double-container.cc.

References Reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddToContainer()

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.

◆ ClearContainer()

void ns3::SatOutputFileStreamLongDoubleContainer::ClearContainer ( )
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().

+ Here is the caller graph for this function:

◆ ConvertValue()

long double ns3::SatOutputFileStreamLongDoubleContainer::ConvertValue ( long double  value)
private

Function for converting the container data samples.

Parameters
valueoriginal data sample value
Returns
converted 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().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::SatOutputFileStreamLongDoubleContainer::DoDispose ( void  )

Do needed dispose actions.

Definition at line 86 of file satellite-output-fstream-long-double-container.cc.

References Reset().

+ Here is the call graph for this function:

◆ EnableFigureOutput()

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.

Parameters
titletitle text
legendYY-axis title
legendXX-axis title
keyPositionLegend position
figureUnitConversionTypeConversion 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.

◆ GetGnuplot()

Gnuplot ns3::SatOutputFileStreamLongDoubleContainer::GetGnuplot ( )
private

Function for creating Gnuplots.

Returns
Gnuplot

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().

+ Here is the caller graph for this function:

◆ GetGnuplotDataset()

Gnuplot2dDataset ns3::SatOutputFileStreamLongDoubleContainer::GetGnuplotDataset ( )
private

Function for creating Gnuplot datasets.

Returns
dataset

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::SatOutputFileStreamLongDoubleContainer::GetTypeId ( void  )
static

NS-3 function for type id.

Returns
type id

Definition at line 33 of file satellite-output-fstream-long-double-container.cc.

◆ OpenStream()

void ns3::SatOutputFileStreamLongDoubleContainer::OpenStream ( )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintFigure()

void ns3::SatOutputFileStreamLongDoubleContainer::PrintFigure ( )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Reset()

void ns3::SatOutputFileStreamLongDoubleContainer::Reset ( void  )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetStream()

void ns3::SatOutputFileStreamLongDoubleContainer::ResetStream ( )
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().

+ Here is the caller graph for this function:

◆ WriteContainerToFile()

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().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_container

std::vector<std::vector<long double> > ns3::SatOutputFileStreamLongDoubleContainer::m_container
private

Container for value rows.

Definition at line 164 of file satellite-output-fstream-long-double-container.h.

Referenced by AddToContainer(), ClearContainer(), GetGnuplotDataset(), and WriteContainerToFile().

◆ m_figureUnitConversionType

FigureUnitConversion_t ns3::SatOutputFileStreamLongDoubleContainer::m_figureUnitConversionType
private

Describes which unit conversion should be used with the figure.

Definition at line 209 of file satellite-output-fstream-long-double-container.h.

Referenced by ConvertValue(), and EnableFigureOutput().

◆ m_fileMode

std::ios::openmode ns3::SatOutputFileStreamLongDoubleContainer::m_fileMode
private

◆ m_fileName

std::string ns3::SatOutputFileStreamLongDoubleContainer::m_fileName
private

◆ m_keyPosition

std::string ns3::SatOutputFileStreamLongDoubleContainer::m_keyPosition
private

Figure legend position.

Definition at line 204 of file satellite-output-fstream-long-double-container.h.

Referenced by EnableFigureOutput(), and GetGnuplot().

◆ m_legendX

std::string ns3::SatOutputFileStreamLongDoubleContainer::m_legendX
private

Figure X-axis title.

Definition at line 199 of file satellite-output-fstream-long-double-container.h.

Referenced by EnableFigureOutput(), and GetGnuplot().

◆ m_legendY

std::string ns3::SatOutputFileStreamLongDoubleContainer::m_legendY
private

Figure Y-axis title.

Definition at line 194 of file satellite-output-fstream-long-double-container.h.

Referenced by EnableFigureOutput(), and GetGnuplot().

◆ m_outputFileStream

std::ofstream* ns3::SatOutputFileStreamLongDoubleContainer::m_outputFileStream
private

Pointer to output file stream.

Definition at line 159 of file satellite-output-fstream-long-double-container.h.

Referenced by OpenStream(), ResetStream(), and WriteContainerToFile().

◆ m_outputFileStreamWrapper

SatOutputFileStreamWrapper* ns3::SatOutputFileStreamLongDoubleContainer::m_outputFileStreamWrapper
private

Pointer to output file stream wrapper.

Definition at line 154 of file satellite-output-fstream-long-double-container.h.

Referenced by OpenStream(), and ResetStream().

◆ m_printFigure

bool ns3::SatOutputFileStreamLongDoubleContainer::m_printFigure
private

Enable / disable printing of container contents into a figure.

Definition at line 184 of file satellite-output-fstream-long-double-container.h.

Referenced by EnableFigureOutput(), and WriteContainerToFile().

◆ m_title

std::string ns3::SatOutputFileStreamLongDoubleContainer::m_title
private

Figure title.

Definition at line 189 of file satellite-output-fstream-long-double-container.h.

Referenced by EnableFigureOutput(), GetGnuplot(), and GetGnuplotDataset().

◆ m_valuesInRow

uint32_t ns3::SatOutputFileStreamLongDoubleContainer::m_valuesInRow
private

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