LatNet Builder Manual  2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
LatticeTester::LatTestWriter< Int > Class Template Referenceabstract

This is an abstract class that represents an interface to Writer classes. More...

#include <LatTestWriter.h>

Inherited by LatticeTester::LatTestWriterRes< Int >.

Public Member Functions

 LatTestWriter (const char *fileName)
 Constructor that opens a Writer to write in the file filename. More...
 
 LatTestWriter (std::ostream *stream)
 Constructor that opens a Writer to write directly in an ostream. More...
 
virtual ~LatTestWriter ()
 Destructor.
 
virtual void beginTabbedSection ()=0
 Begins a tabbed section. More...
 
virtual void endTabbedSection ()=0
 Ends a tabbed section. More...
 
virtual void addTab ()=0
 After this is called, newlines in tabbed sections will have an additional tab. More...
 
virtual void removeTab ()=0
 After this is called, newlines in tabbed sections will have one less tab. More...
 
virtual void clearTab ()=0
 After this is called, newlines in tabbed sections will have no tab. More...
 
virtual void newLine ()=0
 Starts a new line and adds the right amount of tabs if in a tabbed section. More...
 
virtual void newParagraph ()=0
 Starts a new paragraph. More...
 
virtual void writeBool (const bool &value)
 Writes a bool on the stream.
 
virtual void writeInt (const int &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 void writeMathString (const std::string)=0
 Writes a string that is formated and in LaTeX math mode. More...
 
virtual void writeStandOutMathString (const std::string)=0
 Writes a string that is formated and in LaTeX math mode with a newline after and before the string. More...
 
virtual std::ostream & getStream ()
 Returns the stream on which this object writes. More...
 

Protected Attributes

std::ostream * m_stream
 The stream in which the writings are done.
 

Detailed Description

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

This is an abstract class that represents an interface to Writer classes.

That is, this class methods are intended to be used as a way to format an output on an ostream or a file. It already implements functions to write basic data types. A subclass of this class must be implemented if you want to use it. LatTestWriterRes offers utilities to print in a file. Since this class will be overridden, it is possible to implement subclasses to format text for different kind of output such as plain text, \(\LaTeX\) or HTML.

If this class is used on a file, it will automatically print at the start of the file and overwrite it. But if a stream is passed to this object, it will not be modified. That means that it is possible to write on a single stream with multiple writers.

Constructor & Destructor Documentation

◆ LatTestWriter() [1/2]

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

Constructor that opens a Writer to write in the file filename.

This will overwrite the file and start printing at the start.

◆ LatTestWriter() [2/2]

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

Constructor that opens a Writer to write directly in an ostream.

This will not change the stream object. That means that it is possible to create a stream and pass it to different implementations of this interface via this constructor to use different printing formats.

Member Function Documentation

◆ addTab()

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

After this is called, newlines in tabbed sections will have an additional tab.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.

◆ beginTabbedSection()

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

Begins a tabbed section.

In a tabbed section, every newline character is followed by a series of whitespace or tab characters such that the first non-blank characters of the lines in this section are aligned. The amount of tabs in the begginning of the section can be modified with the addTab(), removeTab() and clearTab() methods.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.

◆ clearTab()

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

After this is called, newlines in tabbed sections will have no tab.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.

◆ endTabbedSection()

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

Ends a tabbed section.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.

◆ getStream()

template<typename Int>
virtual std::ostream& LatticeTester::LatTestWriter< Int >::getStream ( )
inlinevirtual

Returns the stream on which this object writes.

If the stream is a simple ostream, this can be used to then print on standard output for example. If this is a file. It can be possible to used different writers in succession.

References LatticeTester::LatTestWriter< Int >::m_stream.

◆ newLine()

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

Starts a new line and adds the right amount of tabs if in a tabbed section.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.

Referenced by LatticeTester::LatticeAnalysis< Int, BasInt, Dbl, RedDbl >::doTestFromInputFile().

◆ newParagraph()

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

Starts a new paragraph.

Automatically ends the tabbed section if the writer was in one.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.

◆ removeTab()

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

After this is called, newlines in tabbed sections will have one less tab.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.

◆ writeMathString()

template<typename Int>
virtual void LatticeTester::LatTestWriter< Int >::writeMathString ( const std::string  )
pure virtual

Writes a string that is formated and in LaTeX math mode.

This can be used to print mathemetical formulas in a standardised format.

This method can be implemented in various way. For example, it is possible to have it print with or without the LaTeX $ signs.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.

◆ writeStandOutMathString()

template<typename Int>
virtual void LatticeTester::LatTestWriter< Int >::writeStandOutMathString ( const std::string  )
pure virtual

Writes a string that is formated and in LaTeX math mode with a newline after and before the string.

This can be used to print mathemetical formulas in a standardised format.

This method can be implemented in various way. For example, it is possible to have it print with or without the LaTeX \equation delimiters.

This is a pure virtual method that has no implementation.

Implemented in LatticeTester::LatTestWriterRes< Int >.


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