Nemo  2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
TraitFileHandler< TP > Class Template Referenceabstract

Template class for the trait's FileHandler. More...

#include <filehandler.h>

+ Inheritance diagram for TraitFileHandler< TP >:
+ Collaboration diagram for TraitFileHandler< TP >:

Public Member Functions

 TraitFileHandler (TP *trait_proto, const char *ext)
 
virtual ~TraitFileHandler ()
 
virtual void FHwrite ()=0
 
virtual void FHread (string &filename)=0
 
virtual void set (bool rpl_per, bool gen_per, int rpl_occ, int gen_occ, int rank, string path, TP *trait_proto)
 
- 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 vector< string > ifExist ()
 Checks if any file associated with the current file name already exists on disk. 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 FHwrite ()=0
 Default behavior of the class, called by Handler::update(). More...
 
virtual void FHread (string &filename)=0
 Default input function. More...
 
virtual void update ()
 Updates the inner replicate and generation counters and calls FHwrite if needed by the the periodicity of the file. More...
 
Metapopget_pop_ptr ()
 Returns the pointer to the current metapop through the FileServices interface. More...
 
void set_pop_ptr (Metapop *pop_ptr)
 
FileServicesget_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)
 
TMatrixget_OccMatrix ()
 
void set_OccMatrix (TMatrix *occ)
 
bool get_isMasterExec ()
 
void set_isMasterExec (bool is)
 
- Public Member Functions inherited from Handler
virtual void init ()=0
 Inits state. More...
 
virtual void update ()=0
 Updates the handler state. More...
 
virtual ~Handler ()
 

Protected Attributes

TP * _FHLinkedTrait
 
int _FHLinkedTraitIndex
 
- Protected Attributes inherited from FileHandler
Metapop_pop
 Pointer to the current metapop, set during initialization within the init function. More...
 

Detailed Description

template<class TP>
class TraitFileHandler< TP >

Template class for the trait's FileHandler.

Constructor links to a given trait prototype. The pointer and index of the trait prototype are stored in the class. They can be accessd through the _FHLinkedTrait and _FHLinkedTraitIndex members to get the stats.

Constructor & Destructor Documentation

◆ TraitFileHandler()

template<class TP >
TraitFileHandler< TP >::TraitFileHandler ( TP *  trait_proto,
const char *  ext 
)
232 :
233FileHandler(ext), _FHLinkedTrait(trait_proto), _FHLinkedTraitIndex(trait_proto->get_index())
234{ }
Interface to handle file input/output for any SimComponent.
Definition: filehandler.h:53
int _FHLinkedTraitIndex
Definition: filehandler.h:220
TP * _FHLinkedTrait
Definition: filehandler.h:219

◆ ~TraitFileHandler()

template<class TP >
virtual TraitFileHandler< TP >::~TraitFileHandler ( )
inlinevirtual
223{}

Member Function Documentation

◆ FHread()

template<class TP >
virtual void TraitFileHandler< TP >::FHread ( string &  filename)
pure virtual

Implements FileHandler.

◆ FHwrite()

template<class TP >
virtual void TraitFileHandler< TP >::FHwrite ( )
pure virtual

◆ set()

template<class TP >
void TraitFileHandler< TP >::set ( bool  rpl_per,
bool  gen_per,
int  rpl_occ,
int  gen_occ,
int  rank,
string  path,
TP *  trait_proto 
)
virtual
237{
238 FileHandler::set(rpl_per, gen_per, rpl_occ, gen_occ,rank, path);
239 _FHLinkedTrait = trait_proto;
240 _FHLinkedTraitIndex = trait_proto->get_index();
241}
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

References FileHandler::set().

Referenced by TProtoBDMI::loadFileServices(), TProtoDeletMutations_bitstring::loadFileServices(), TProtoNeutralGenes::loadFileServices(), and TProtoQuanti::loadFileServices().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _FHLinkedTrait

template<class TP >
TP* TraitFileHandler< TP >::_FHLinkedTrait
protected

◆ _FHLinkedTraitIndex

template<class TP >
int TraitFileHandler< TP >::_FHLinkedTraitIndex
protected

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

Generated for Nemo v2.3.56 by  doxygen 1.9.0 -- Nemo is hosted on  Download Nemo

Locations of visitors to this page
Catalogued on GSR