NOMAD Source
Version 4.0.0 Beta
|
Go to the documentation of this file.
46 #ifndef __NOMAD400_OUTPUTQUEUE__
47 #define __NOMAD400_OUTPUTQUEUE__
58 #include "../Param/DisplayParameters.hpp"
59 #include "../Output/OutputInfo.hpp"
60 #include "../Output/StatsInfo.hpp"
62 #include "../nomad_nsbegin.hpp"
88 void initParameters(
const std::shared_ptr<DisplayParameters>& params);
99 void add(
const std::string& s,
101 static void Add(
const std::string& s,
147 #define OUTPUT_STATS_START if (OutputQueue::GoodLevel(OutputLevel::LEVEL_STATS)) {
148 #define OUTPUT_INFO_START if (OutputQueue::GoodLevel(OutputLevel::LEVEL_INFO)) {
149 #define OUTPUT_DEBUG_START if (OutputQueue::GoodLevel(OutputLevel::LEVEL_DEBUG)) {
150 #define OUTPUT_STATS_END }
151 #define OUTPUT_INFO_END }
152 #define OUTPUT_DEBUG_END }
178 static omp_lock_t _s_queue_lock;
229 #include "../nomad_nsend.hpp"
231 #endif // __NOMAD400_OUTPUTQUEUE__
OutputLevel
Level of output AKA Display degree.
static bool _hasBeenInitialized
Flag for initialization (initialization cannot be performed more than once).
OutputQueue()
Private constructor.
static void Flush()
Print all in the queue and flush.
void setStatsFileFormat(const DisplayStatsTypeList &statsFileFormat)
const std::string _blockStart
Symbol for a block start.
size_t getMaxStepLevel() const
static bool GoodLevel(const OutputLevel &outputLevel)
static void Add(const StatsInfo &statsInfo)
static void Add(OutputInfo outputInfo)
std::vector< OutputInfo > _queue
Queue of all the OutputInfo we have to print.
void setMaxStepLevel(const size_t maxStepLevel)
Class for the representation of an array of n strings.
const ArrayOfDouble & getSolFormat() const
void add(OutputInfo outputInfo)
void flushStatsToStdout(const StatsInfo *statsInfo)
Information for stats format (parameters DISPLAY_STATS and STATS_FILE).
void setDisplayDegree(const int displayDegree)
std::ofstream _statsStream
OutputLevel _maxOutputLevel
Output level (~display degree) we want to print out.
void reset()
Flush and close stats file (called by initParameters) if OutputQueue has been already initialized.
int _indentLevel
Internal indentation level.
const std::string _blockEnd
Symbol for an end block.
void initParameters(const std::shared_ptr< DisplayParameters > ¶ms)
Class for the representation of an array of n values.
static void Add(const std::string &s, OutputLevel outputLevel=OutputLevel::LEVEL_INFO)
size_t _maxStepLevel
Maximum step level we want to print out.
void flushBlock(const OutputInfo &outputInfo)
DisplayStatsTypeList _statsFileFormat
void flushStatsToStatsFile(const StatsInfo *statsInfo)
const std::string & getStatsFileName() const
static std::unique_ptr< OutputQueue > & getInstance()
Access to singleton.
@ LEVEL_INFO
Lots of information.
bool goodLevel(const OutputLevel &outputLevel) const
static std::unique_ptr< OutputQueue > _single
The singleton.
std::shared_ptr< DisplayParameters > _params
Display parameters.
Queue of all information that was not output yet.
const DisplayStatsTypeList & getStatsFileFormat() const
void setStatsFileName(const std::string &statsFile)