Queue of all information that was not output yet.
More...
#include <OutputQueue.hpp>
Queue of all information that was not output yet.
The output queue is a singleton. Some OutputInfo can be added to the queue. The output information is displayed when calling OutputQueue::Flush and queue is emptied.
The information can be send to the standard display and to a stats file.
The display is formatted with indendation of blocks of information. The display parameters (DisplayParameters) are attributes of the class provided by calling OutputQueue::initParameters.
The display can be limited to a maximum block/step level. (OutputQueue::_maxStepLevel).
- Todo:
- Replace calls to std::cout by something more general.
Definition at line 75 of file OutputQueue.hpp.
◆ OutputQueue()
OutputQueue::OutputQueue |
( |
| ) |
|
|
private |
◆ ~OutputQueue()
virtual OutputQueue::~OutputQueue |
( |
| ) |
|
|
virtual |
◆ add() [1/3]
void OutputQueue::add |
( |
const StatsInfo & |
statsInfo | ) |
|
◆ Add() [1/3]
static void OutputQueue::Add |
( |
const StatsInfo & |
statsInfo | ) |
|
|
inlinestatic |
◆ add() [2/3]
◆ Add() [2/3]
◆ add() [3/3]
◆ Add() [3/3]
static void OutputQueue::Add |
( |
OutputInfo |
outputInfo | ) |
|
|
inlinestatic |
◆ endBlock()
void OutputQueue::endBlock |
( |
| ) |
|
|
private |
◆ Flush()
static void OutputQueue::Flush |
( |
| ) |
|
|
inlinestatic |
Print all in the queue and flush.
OutputInfo block start and block end flags will print _blockStart after the msg, or _blockEnd before.
- Note
- Example output:
Start step MADS {
_______Start step SEARCH {
_____________Things happening in SEARCH
_____________More things happening in SEARCH
_______} End step SEARCH
_______Start step POLL {
_____________Things happening in POLL
_____________More things happening in POLL
_______} End step POLL
} End step MADS
If there are more than one line to print, flags for block start and end are ignored.
Definition at line 131 of file OutputQueue.hpp.
◆ flush()
void OutputQueue::flush |
( |
| ) |
|
|
private |
◆ flushBlock()
void OutputQueue::flushBlock |
( |
const OutputInfo & |
outputInfo | ) |
|
|
private |
◆ flushStatsToStatsFile()
void OutputQueue::flushStatsToStatsFile |
( |
const StatsInfo * |
statsInfo | ) |
|
|
private |
◆ flushStatsToStdout()
void OutputQueue::flushStatsToStdout |
( |
const StatsInfo * |
statsInfo | ) |
|
|
private |
◆ getInstance()
static std::unique_ptr<OutputQueue>& OutputQueue::getInstance |
( |
| ) |
|
|
static |
◆ getMaxStepLevel()
size_t OutputQueue::getMaxStepLevel |
( |
| ) |
const |
|
inline |
◆ getSolFormat()
◆ getStatsFileFormat()
◆ getStatsFileName()
const std::string& OutputQueue::getStatsFileName |
( |
| ) |
const |
|
inline |
◆ GoodLevel()
static bool OutputQueue::GoodLevel |
( |
const OutputLevel & |
outputLevel | ) |
|
|
inlinestatic |
◆ goodLevel()
bool OutputQueue::goodLevel |
( |
const OutputLevel & |
outputLevel | ) |
const |
◆ indent()
void OutputQueue::indent |
( |
int |
level | ) |
|
|
private |
◆ initParameters()
void OutputQueue::initParameters |
( |
const std::shared_ptr< DisplayParameters > & |
params | ) |
|
◆ initStatsFile()
void OutputQueue::initStatsFile |
( |
| ) |
|
◆ reset()
void OutputQueue::reset |
( |
| ) |
|
Flush and close stats file (called by initParameters) if OutputQueue has been already initialized.
◆ setDisplayDegree()
void OutputQueue::setDisplayDegree |
( |
const int |
displayDegree | ) |
|
◆ setMaxStepLevel()
void OutputQueue::setMaxStepLevel |
( |
const size_t |
maxStepLevel | ) |
|
|
inline |
◆ setStatsFileFormat()
◆ setStatsFileName()
void OutputQueue::setStatsFileName |
( |
const std::string & |
statsFile | ) |
|
|
inline |
◆ startBlock()
void OutputQueue::startBlock |
( |
| ) |
|
|
private |
◆ _blockEnd
const std::string OutputQueue::_blockEnd |
|
private |
◆ _blockStart
const std::string OutputQueue::_blockStart |
|
private |
◆ _hasBeenInitialized
bool OutputQueue::_hasBeenInitialized |
|
staticprivate |
Flag for initialization (initialization cannot be performed more than once).
Definition at line 181 of file OutputQueue.hpp.
◆ _hWidth
size_t OutputQueue::_hWidth |
|
private |
◆ _indentLevel
int OutputQueue::_indentLevel |
|
private |
◆ _maxOutputLevel
Output level (~display degree) we want to print out.
Definition at line 214 of file OutputQueue.hpp.
◆ _maxStepLevel
size_t OutputQueue::_maxStepLevel |
|
private |
◆ _objWidth
size_t OutputQueue::_objWidth |
|
private |
Format width for OBJ and CONS_H. May be enlarged during the run.
Definition at line 209 of file OutputQueue.hpp.
◆ _params
◆ _queue
◆ _single
◆ _statsFile
std::string OutputQueue::_statsFile |
|
private |
◆ _statsFileFormat
Format for stats in a file (parameter STATS_FILE). Might include some raw strings, do not convert to DisplayStatsType.
Definition at line 198 of file OutputQueue.hpp.
◆ _statsLineCount
size_t OutputQueue::_statsLineCount |
|
private |
Keep track of the number of lines printed to output (DISPLAY_STATS). Used to print stats header regularly.
Definition at line 204 of file OutputQueue.hpp.
◆ _statsStream
std::ofstream OutputQueue::_statsStream |
|
private |
The documentation for this class was generated from the following file: