Nemo  2.2.0
Public Member Functions
FHLogWriter Class Reference

File Handler used to save the simulation parameters to a log file. More...

#include <filehandler.h>

+ Inheritance diagram for FHLogWriter:
+ Collaboration diagram for FHLogWriter:

List of all members.

Public Member Functions

 FHLogWriter ()
virtual ~FHLogWriter ()
virtual void FHwrite ()
 Default behavior of the class, called by Handler::update().
virtual void FHread (string &filename)
 Default input function.
void save_simparams (list< ParamSet * > &params)

Detailed Description

File Handler used to save the simulation parameters to a log file.

Definition at line 250 of file filehandler.h.


Constructor & Destructor Documentation

FHLogWriter::FHLogWriter ( ) [inline]

Definition at line 252 of file filehandler.h.

: FileHandler(".log"){};
virtual FHLogWriter::~FHLogWriter ( ) [inline, virtual]

Definition at line 253 of file filehandler.h.

{}

Member Function Documentation

virtual void FHLogWriter::FHread ( string &  filename) [inline, virtual]

Default input function.

Loads a pop from the genotypes read from the input file.

Implements FileHandler.

Definition at line 256 of file filehandler.h.

{}
virtual void FHLogWriter::FHwrite ( ) [inline, virtual]

Default behavior of the class, called by Handler::update().

Implements FileHandler.

Definition at line 255 of file filehandler.h.

{}//@TODO implement log writer procedures
void FHLogWriter::save_simparams ( list< ParamSet * > &  params)

Definition at line 181 of file filehandler.cc.

References error(), MAIN_VERSION, MINOR_VERSION, RELEASE, REVISION, and VERSION_DATE.

Referenced by FileServices::init().

{
  string file=get_filename();
  
  ofstream FH(file.c_str(),ios::out);
  
  if(!FH) {
    error("FileServices::init: could not output sim parameters to\"%s\"\n",file.c_str());
    FH.close();
    return;
  }
  
  list< ParamSet* >::iterator Pit = params.begin();
  char t_buff[20];
  time_t t = time(NULL);
  strftime(t_buff, 20, "%d-%m-%Y %H:%M:%S", localtime(&t));
  
  FH<<"# Nemo    v"<<MAIN_VERSION<<"."<<MINOR_VERSION<<"."<<REVISION<<RELEASE
  <<"  "<<VERSION_DATE<<endl<<"#"<<endl;
  FH<<"# simulation started on "<<t_buff<<endl<<endl;
  
  while(Pit != params.end()) {
    FH<<endl;
    (*Pit)->print(FH);
    Pit++;
  }
  FH<<endl;
  
  FH.close();
}

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

Generated for Nemo v2.2.0 by  doxygen 1.7.5.1 -- Nemo is hosted by  SourceForge.net Logo