WSF
wsf::coverage::MeasureTextOutput Class Referenceabstract

#include <WsfCoverageMeasureTextOutput.hpp>

Inheritance diagram for wsf::coverage::MeasureTextOutput:
Collaboration diagram for wsf::coverage::MeasureTextOutput:

Public Member Functions

 MeasureTextOutput ()
 MeasureTextOutput (std::unique_ptr< TextOutputWriter > aWriterPtr)
 MeasureTextOutput (const MeasureTextOutput &aOther)=default
 ~MeasureTextOutput () override=default
bool ProcessInput (UtInput &aInput) override
void Write (const Coverage &aCoverage, const Measure &aMeasure) override
void SetFileNameToDefault (const Coverage &aCoverage, const Measure &aMeasure) override
TextOutputWriterGetWriter ()
 Return the writer being used by this object.
Public Member Functions inherited from wsf::coverage::MeasureOutput
 MeasureOutput ()=default
 MeasureOutput (const MeasureOutput &aOther)=default
 ~MeasureOutput () override=default
MeasureOutputClone () const override=0
virtual std::string GetOutputType () const =0
const std::string & GetFileName () const
 Return the file name into which output will be written.
const std::string & GetOutputDir () const
 Return the directory into which any files will be generated.
void SetFileName (const std::string &aFileName)
 Set the file name into which output will be written.
void SetOutputDir (const std::string &aOutputDir)
 Set the directory into which any files will be generated.
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)

Additional Inherited Members

Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Detailed Description

This class collects some common behavior for text output file for measure data.

This class defers both settings management and the actual writing to streams to an owned instance of a TextOutputWriter. This member has a sensible default, but that default can be overridden. For example, a subclass of TextOutputWriter that writes to a string stream instead of a file is useful for unit tests.

Constructor & Destructor Documentation

◆ MeasureTextOutput() [1/3]

◆ MeasureTextOutput() [2/3]

wsf::coverage::MeasureTextOutput::MeasureTextOutput ( std::unique_ptr< TextOutputWriter > aWriterPtr)
explicit

◆ MeasureTextOutput() [3/3]

wsf::coverage::MeasureTextOutput::MeasureTextOutput ( const MeasureTextOutput & aOther)
default

References MeasureTextOutput().

◆ ~MeasureTextOutput()

wsf::coverage::MeasureTextOutput::~MeasureTextOutput ( )
overridedefault

Member Function Documentation

◆ GetWriter()

TextOutputWriter & wsf::coverage::MeasureTextOutput::GetWriter ( )
inline

Return the writer being used by this object.

◆ ProcessInput()

bool wsf::coverage::MeasureTextOutput::ProcessInput ( UtInput & aInput)
overridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from wsf::coverage::MeasureOutput.

References wsf::coverage::TextOutputWriter::cMAX_PRECISION, wsf::coverage::TextOutputWriter::cMAX_WIDTH, wsf::coverage::TextOutputWriter::cMIN_PRECISION, wsf::coverage::TextOutputWriter::cMIN_WIDTH, and wsf::coverage::MeasureOutput::ProcessInput().

Referenced by wsf::coverage::MeasureLatLonStatsOutput::ProcessInput(), and ~MeasureTextOutput().

◆ SetFileNameToDefault()

void wsf::coverage::MeasureTextOutput::SetFileNameToDefault ( const Coverage & aCoverage,
const Measure & aMeasure )
overridevirtual

Set the filename to a default value that is reasonably unique.

To avoid the user having to manually set the name of every file, MeasureOutput provides an automatic naming feature. Subclasses should implement this so that the default names have a reasonable chance of being unique.

Parameters
aCoverage- The coverage object defining the measure.
aMeasure- The measure to be output.

Implements wsf::coverage::MeasureOutput.

References wsf::coverage::MeasureOutput::GetFileName(), WsfObject::GetName(), and wsf::coverage::MeasureOutput::SetFileName().

Referenced by ~MeasureTextOutput().

◆ Write()

void wsf::coverage::MeasureTextOutput::Write ( const Coverage & aCoverage,
const Measure & aMeasure )
overridevirtual

Write the measured data to a text file.

This method uses the template pattern, calling into operations on the owned TextOutputWriter and on the subclass.

Parameters
aCoverage- The coverage defining the given aMeasure.
aMeasure- The measured data to be written to file.

Implements wsf::coverage::MeasureOutput.

References wsf::coverage::MeasureOutput::GetFileName(), and wsf::coverage::MeasureOutput::GetOutputDir().

Referenced by ~MeasureTextOutput().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved