Lattice Tester Online Documentation 0.1.0-861
Software Package For Testing The Uniformity Of Integral Lattices In The Real Space
Loading...
Searching...
No Matches
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>

+ Inheritance diagram for LatticeTester::WriterRes< Int >:

Public Member Functions

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

Protected Attributes

bool m_isTabbed = false
 Indicates if we currently are in a tabbed section.
 
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.
 
- Protected Attributes inherited from LatticeTester::Writer< Int >
std::ostream * m_stream
 The stream in which the writings are done.
 

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: