Gadget
Public Member Functions | Protected Attributes | List of all members
Printer Class Referenceabstract

This is the base class used to print the modelled population during a model simulation. More...

#include <printer.h>

Inheritance diagram for Printer:
Inheritance graph
Collaboration diagram for Printer:
Collaboration graph

Public Member Functions

 Printer (PrinterType ptype)
 This is the default Printer constructor. More...
 
virtual ~Printer ()
 This is the default Printer destructor. More...
 
virtual void Print (const TimeClass *const TimeInfo, int printtime)=0
 This will print the requested information for the printer class to the ofstream specified. More...
 
virtual void setStock (StockPtrVector &stockvec, const AreaClass *const Area)
 This will select the stocks required for the printer class to print the requested information. More...
 
virtual void setPredAndPrey (PredatorPtrVector &predatorvec, PreyPtrVector &preyvec, const AreaClass *const Area)
 This will select the predators and preys required for the printer class to print the requested information. More...
 
virtual void setPrey (PreyPtrVector &preyvec, const AreaClass *const Area)
 This will select the preys required for the printer class to print the requested information. More...
 
virtual void setPredator (PredatorPtrVector &predatorvec, const AreaClass *const Area)
 This will select the predators required for the printer class to print the requested information. More...
 
virtual void setLikelihood (LikelihoodPtrVector &likevec)
 This will select the likelihood components required for the printer class to print the requested information. More...
 
const char * getFileName () const
 This will return the name of the output file. More...
 
PrinterType getType () const
 This will return the type of printer class. More...
 

Protected Attributes

ActionAtTimes AAT
 This ActionAtTimes stores information about when the printer output is required in the model. More...
 
char * filename
 This is the name of the output file that all the model information will get sent to. More...
 
ofstream outfile
 This ofstream is the file that all the model information gets sent to. More...
 
int printtimeid
 This is the flag used to denote whether the printing takes place at the start or the end of the timestep. More...
 
int precision
 This is precision which can be used to override the default values when printing the information to the output file. More...
 
int width
 This is width used when printing the information to the output file. More...
 

Detailed Description

This is the base class used to print the modelled population during a model simulation.

Note
This will always be overridden by the derived classes that actually print the required information

Constructor & Destructor Documentation

◆ Printer()

Printer::Printer ( PrinterType  ptype)
inline

This is the default Printer constructor.

Parameters
ptypeis the PrinterType of the printer

◆ ~Printer()

virtual Printer::~Printer ( )
inlinevirtual

This is the default Printer destructor.

Member Function Documentation

◆ getFileName()

const char* Printer::getFileName ( ) const
inline

This will return the name of the output file.

Returns
name

◆ getType()

PrinterType Printer::getType ( ) const
inline

This will return the type of printer class.

Returns
type

◆ Print()

virtual void Printer::Print ( const TimeClass *const  TimeInfo,
int  printtime 
)
pure virtual

This will print the requested information for the printer class to the ofstream specified.

Parameters
TimeInfois the TimeClass for the current model
printtimeis the flag to denote when the printing is taking place

Implemented in SummaryPrinter, StockStdPrinter, StockPrinter, StockPreyPrinter, StockPreyFullPrinter, StockFullPrinter, PreyOverPrinter, PredatorPrinter, PredatorPreyPrinter, PredatorOverPrinter, and LikelihoodPrinter.

◆ setLikelihood()

virtual void Printer::setLikelihood ( LikelihoodPtrVector likevec)
inlinevirtual

This will select the likelihood components required for the printer class to print the requested information.

Parameters
likevecis the LikelihoodPtrVector of all the available likelihood components

Reimplemented in SummaryPrinter, and LikelihoodPrinter.

◆ setPredAndPrey()

virtual void Printer::setPredAndPrey ( PredatorPtrVector predatorvec,
PreyPtrVector preyvec,
const AreaClass *const  Area 
)
inlinevirtual

This will select the predators and preys required for the printer class to print the requested information.

Parameters
predatorvecis the PredatorPtrVector of all the available predators
preyvecis the PreyPtrVector of all the available preys
Areais the AreaClass for the current model

Reimplemented in PredatorPrinter, and PredatorPreyPrinter.

◆ setPredator()

virtual void Printer::setPredator ( PredatorPtrVector predatorvec,
const AreaClass *const  Area 
)
inlinevirtual

This will select the predators required for the printer class to print the requested information.

Parameters
predatorvecis the PredatorPtrVector of all the available predators
Areais the AreaClass for the current model

Reimplemented in PredatorOverPrinter.

◆ setPrey()

virtual void Printer::setPrey ( PreyPtrVector preyvec,
const AreaClass *const  Area 
)
inlinevirtual

This will select the preys required for the printer class to print the requested information.

Parameters
preyvecis the PreyPtrVector of all the available preys
Areais the AreaClass for the current model

Reimplemented in StockPreyPrinter, StockPreyFullPrinter, and PreyOverPrinter.

◆ setStock()

virtual void Printer::setStock ( StockPtrVector stockvec,
const AreaClass *const  Area 
)
inlinevirtual

This will select the stocks required for the printer class to print the requested information.

Parameters
stockvecis the StockPtrVector of all the available stocks
Areais the AreaClass for the current model

Reimplemented in StockStdPrinter, StockPrinter, and StockFullPrinter.

Member Data Documentation

◆ AAT

ActionAtTimes Printer::AAT
protected

This ActionAtTimes stores information about when the printer output is required in the model.

◆ filename

char* Printer::filename
protected

This is the name of the output file that all the model information will get sent to.

◆ outfile

ofstream Printer::outfile
protected

This ofstream is the file that all the model information gets sent to.

◆ precision

int Printer::precision
protected

This is precision which can be used to override the default values when printing the information to the output file.

Note
The default value is 0, which corresponds to using values specified in gadget.h

◆ printtimeid

int Printer::printtimeid
protected

This is the flag used to denote whether the printing takes place at the start or the end of the timestep.

Note
The default value is 0, which corresponds to printing at the end of the timestep

◆ width

int Printer::width
protected

This is width used when printing the information to the output file.

Note
This value is set to precision + 4

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