FileHandler of the LCE_StatServiceNotifier class, writes the recorded stats to txt files.
More...
#include <servicenotifiers.h>
|
| | LCE_StatFH () |
| |
| | ~LCE_StatFH () |
| |
| virtual vector< string > | ifExist () |
| |
| void | set_statService (StatServices *srv) |
| |
| virtual void | FHwrite () |
| |
| virtual void | FHread (string &filename) |
| |
| void | PrintStat_byGen () |
| |
Public Member Functions inherited from FileHandler |
| | FileHandler (const char *ext) |
| |
| virtual | ~FileHandler () |
| |
| virtual void | init () |
| | Called by notifier during simulation setup, performs file checking. More...
|
| |
| virtual void | set (bool rpl_per, bool gen_per, int rpl_occ, int gen_occ, int rank, string path) |
| | Sets the hanlder parameters. More...
|
| |
| virtual void | set_multi (bool rpl_per, bool gen_per, int rpl_occ, TMatrix *Occ, string path) |
| |
| virtual void | update () |
| | Updates the inner replicate and generation counters and calls FHwrite if needed by the the periodicity of the file. More...
|
| |
| Metapop * | get_pop_ptr () |
| | Returns the pointer to the current metapop through the FileServices interface. More...
|
| |
| void | set_pop_ptr (Metapop *pop_ptr) |
| |
| FileServices * | get_service () |
| | Returns pointer to the FileServices. More...
|
| |
| void | set_service (FileServices *srv) |
| |
| std::string & | get_path () |
| |
| void | set_path () |
| |
| std::string & | get_extension () |
| |
| void | set_extension (const char *ext) |
| |
| std::string & | get_filename () |
| | Builds and returns the current file name depending on the periodicity of the file. More...
|
| |
| bool | get_isInputHandler () |
| |
| void | set_isInputHandler (bool val) |
| |
| bool | get_isReplicatePeriodic () |
| |
| void | set_isReplicatePeriodic (bool val) |
| |
| unsigned int | get_ReplicateOccurrence () |
| |
| void | set_ReplicateOccurrence (unsigned int val) |
| |
| bool | get_isGenerationPeriodic () |
| |
| void | set_isGenerationPeriodic (bool val) |
| |
| unsigned int | get_GenerationOccurrence () |
| |
| void | set_GenerationOccurrence (unsigned int val) |
| |
| unsigned int | get_ExecRank () |
| | unused yet... More...
|
| |
| void | set_ExecRank (int val) |
| |
| TMatrix * | get_OccMatrix () |
| |
| void | set_OccMatrix (TMatrix *occ) |
| |
| bool | get_isMasterExec () |
| |
| void | set_isMasterExec (bool is) |
| |
Public Member Functions inherited from Handler |
| virtual | ~Handler () |
| |
|
Protected Attributes inherited from FileHandler |
| Metapop * | _pop |
| | Pointer to the current metapop, set during initialization within the init function. More...
|
| |
FileHandler of the LCE_StatServiceNotifier class, writes the recorded stats to txt files.
◆ LCE_StatFH()
| LCE_StatFH::LCE_StatFH |
( |
| ) |
|
|
inline |
void set_isMasterExec(bool is)
Definition: filehandler.h:182
virtual void set(bool rpl_per, bool gen_per, int rpl_occ, int gen_occ, int rank, string path)
Sets the hanlder parameters.
Definition: filehandler.h:193
FileHandler(const char *ext)
Definition: filehandler.h:107
StatServices * _statService
Definition: servicenotifiers.h:134
References FileHandler::set(), and FileHandler::set_isMasterExec().
◆ ~LCE_StatFH()
| LCE_StatFH::~LCE_StatFH |
( |
| ) |
|
|
inline |
◆ FHread()
| virtual void LCE_StatFH::FHread |
( |
string & |
filename | ) |
|
|
inlinevirtual |
◆ FHwrite()
| void LCE_StatFH::FHwrite |
( |
| ) |
|
|
virtual |
Implements FileHandler.
412 message(
"LCE_StatFH::FHwrite (%s)\n",filename.c_str());
417 FH.open(filename.c_str(),ios::trunc);
419 if(!FH)
fatal(
"LCE_StatFH::FHwrite:: could not open stat output file \"%s\"\n",filename.c_str());
423 FH.open(filename.c_str(),ios::app);
425 if(!FH)
fatal(
"LCE_StatFH::FHwrite:: could not open stat output file \"%s\"\n",filename.c_str());
std::string & get_path()
Definition: filehandler.h:139
FileServices * get_service()
Returns pointer to the FileServices.
Definition: filehandler.h:135
std::string & get_extension()
Definition: filehandler.h:143
string & getBaseFileName()
Accessor to the base file name of the simulation.
Definition: fileservices.cc:446
void PrintStat_byGen()
Definition: servicenotifiers.cc:442
static unsigned int getReplicates()
Definition: simenv.h:63
static unsigned int getCurrentReplicate()
Definition: simenv.h:62
bool getPrintAveragesOpt()
Definition: statservices.h:144
void printStatValue(ofstream &FH, unsigned int repl_idx)
Prints the stat values to the '.txt' output file.
Definition: statservices.cc:289
void fatal(const char *str,...)
Definition: output.cc:96
void message(const char *message,...)
Definition: output.cc:40
References _statService, fatal(), FileHandler::get_extension(), FileHandler::get_path(), FileHandler::get_service(), FileServices::getBaseFileName(), SIMenv::getCurrentReplicate(), StatServices::getPrintAveragesOpt(), SIMenv::getReplicates(), message(), PrintStat_byGen(), and StatServices::printStatValue().
◆ ifExist()
| vector< string > LCE_StatFH::ifExist |
( |
| ) |
|
|
virtual |
Reimplemented from FileHandler.
373 ifstream ifExist1, ifExist2;
374 ifExist1.setstate(ios::failbit);
375 ifExist2.setstate(ios::failbit);
380 vector< string > list;
382 ifExist1.open(filename.c_str(),ios::in);
383 if(ifExist1.is_open()) {
385 list.push_back(filename);
392 ifExist2.open(filename.c_str(),ios::in);
393 if(ifExist2.is_open()) {
395 list.push_back(filename);
References FileHandler::get_path(), FileHandler::get_service(), and FileServices::getBaseFileName().
◆ PrintStat_byGen()
| void LCE_StatFH::PrintStat_byGen |
( |
| ) |
|
◆ set_statService()
◆ _statService
The documentation for this class was generated from the following files: