Lattice Tester Guide  1.0-9
Software Package For Testing The Uniformity Of Integral Lattices In The Real Space
LatticeTester::WriterRes< Int > Class Template Reference

This class is a simple implementation of the Writer abstract class to write in plain text format on the stream. More...

#include <latticetester/WriterRes.h>

Inherits LatticeTester::Writer< Int >.

Public Member Functions

 WriterRes (const char *fileName)
 Constructor that opens the writer to write at the beginning of file fileName. More...
 
 WriterRes (std::ostream *stream)
 Constructor that will use stream as an output stream. More...
 
void beginTabbedSection ()
 Implementation of the method defined in Writer. More...
 
void endTabbedSection ()
 Implementation of the method defined in Writer. More...
 
void addTab ()
 Implementation of the method defined in Writer. More...
 
void removeTab ()
 Implementation of the method defined in Writer. More...
 
void clearTab ()
 Implementation of the method defined in Writer. More...
 
void defaultTab ()
 Implementation of the method defined in Writer. More...
 
void newLine ()
 Implementation of the method defined in Writer. More...
 
void newParagraph ()
 Implementation of the method defined in Writer. More...
 
void writeMathString (const std::string)
 Implementation of the method defined in Writer. More...
 
void writeStandOutMathString (const std::string)
 Implementation of the method defined in Writer. More...
 
- Public Member Functions inherited from LatticeTester::Writer< Int >
 Writer (const char *fileName)
 Constructor that opens a Writer to write in the file filename. More...
 
 Writer (std::ostream *stream)
 Constructor that opens a Writer to write directly in an ostream. More...
 
virtual ~Writer ()
 Destructor. More...
 
virtual void writeBool (const bool &value)
 Writes a bool on the stream. More...
 
virtual void writeInt (const int &value)
 Writes an int on the stream. More...
 
virtual void writeString (const std::string &value)
 Writes a string on the stream. More...
 
virtual void writeDouble (const double &value)
 Writes a double on the stream. More...
 
virtual void writeIntScal (const Int &value)
 Writes a IntScal on the stream. More...
 
virtual void writeMMat (const IntMat &A)
 Writes a IntMat on the stream. More...
 
virtual std::ostream & getStream ()
 Returns the stream on which this object writes. More...
 

Protected Attributes

bool m_isTabbed = false
 Indicates if we currently are in a tabbed section. More...
 
std::string m_prefix
 Used to remember the state of the tabs and white spaces needed to align correctly a line, for instance when in a tabbed section. More...
 
- Protected Attributes inherited from LatticeTester::Writer< Int >
std::ostream * m_stream
 The stream in which the writings are done. More...
 

Detailed Description

template<typename Int>
class LatticeTester::WriterRes< Int >

This class is a simple implementation of the Writer abstract class to write in plain text format on the stream.

This class defines no other method than the interface and can be viewed as an example to what the Writer interface is intended to be.

Constructor & Destructor Documentation

◆ WriterRes() [1/2]

template<typename Int >
LatticeTester::WriterRes< Int >::WriterRes ( const char *  fileName)

Constructor that opens the writer to write at the beginning of file fileName.

◆ WriterRes() [2/2]

template<typename Int >
LatticeTester::WriterRes< Int >::WriterRes ( std::ostream *  stream)

Constructor that will use stream as an output stream.

This will make the writer start writing at the end of the stream.

Member Function Documentation

◆ addTab()

template<typename Int >
void LatticeTester::WriterRes< Int >::addTab ( )
virtual

Implementation of the method defined in Writer.

This adds 2 spaces to the prefix of tabbed sections.

Implements LatticeTester::Writer< Int >.

◆ beginTabbedSection()

template<typename Int >
void LatticeTester::WriterRes< Int >::beginTabbedSection ( )
virtual

Implementation of the method defined in Writer.

In this class, by default, a tabbed section has 2 spaces at the beginning of lines. Calling this methods resets the prefix of tabbed sections to the default.

Implements LatticeTester::Writer< Int >.

◆ clearTab()

template<typename Int >
void LatticeTester::WriterRes< Int >::clearTab ( )
virtual

Implementation of the method defined in Writer.

This sets the prefix of tabbed sections to an empty string.

Implements LatticeTester::Writer< Int >.

◆ defaultTab()

template<typename Int >
void LatticeTester::WriterRes< Int >::defaultTab ( )
virtual

Implementation of the method defined in Writer.

This sets the prefix of tabbed sections to a string with 2 spaces.

Implements LatticeTester::Writer< Int >.

◆ endTabbedSection()

template<typename Int >
void LatticeTester::WriterRes< Int >::endTabbedSection ( )
virtual

Implementation of the method defined in Writer.

Implements LatticeTester::Writer< Int >.

◆ newLine()

template<typename Int >
void LatticeTester::WriterRes< Int >::newLine ( )
virtual

Implementation of the method defined in Writer.

Prints a newline character and the prefix of a tabbed section if a the writer is in a tabbed section.

Implements LatticeTester::Writer< Int >.

◆ newParagraph()

template<typename Int >
void LatticeTester::WriterRes< Int >::newParagraph ( )
virtual

Implementation of the method defined in Writer.

Prints 2 newline characters and ends the tabbed section if the program is in a tabbed section.

Implements LatticeTester::Writer< Int >.

◆ removeTab()

template<typename Int >
void LatticeTester::WriterRes< Int >::removeTab ( )
virtual

Implementation of the method defined in Writer.

This removes 2 spaces to the prefix of tabbed sections.

Implements LatticeTester::Writer< Int >.

◆ writeMathString()

template<typename Int >
void LatticeTester::WriterRes< Int >::writeMathString ( const std::string  s)
virtual

Implementation of the method defined in Writer.

This writes the string passed as an argument to the output string.

Implements LatticeTester::Writer< Int >.

◆ writeStandOutMathString()

template<typename Int >
void LatticeTester::WriterRes< Int >::writeStandOutMathString ( const std::string  s)
virtual

Implementation of the method defined in Writer.

This writes the string passed as argument in a tabbed section with a newline character before and after.

Implements LatticeTester::Writer< Int >.

Member Data Documentation

◆ m_isTabbed

template<typename Int>
bool LatticeTester::WriterRes< Int >::m_isTabbed = false
protected

Indicates if we currently are in a tabbed section.

The methods of this class will print m_prefix at each newline if m_isTabbed is true.

◆ m_prefix

template<typename Int>
std::string LatticeTester::WriterRes< Int >::m_prefix
protected

Used to remember the state of the tabs and white spaces needed to align correctly a line, for instance when in a tabbed section.


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