BioDynaMo  v1.03.58-27764645
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
bdm::SimulationBackup Class Reference

#include <simulation_backup.h>

Collaboration diagram for bdm::SimulationBackup:
[legend]

Public Member Functions

 SimulationBackup (const std::string &backup_file, const std::string &restore_file)
 
void Backup (size_t completed_simulation_steps)
 
void Restore ()
 
size_t GetSimulationStepsFromBackup ()
 
bool BackupEnabled ()
 
bool RestoreEnabled ()
 

Static Public Attributes

static const std::string kSimulationName = "simulation"
 
static const std::string kSimulationStepName
 
static const std::string kRuntimeVariableName = "runtime_variable"
 
static std::vector< std::function< void()> > after_restore_event_ = {}
 

Private Attributes

bool backup_ = false
 
bool restore_ = true
 
std::string backup_file
 
std::string restore_file
 

Detailed Description

SimulationBackup is responsible for backing up and restoring all relevant simulation information.

Definition at line 33 of file simulation_backup.h.

Constructor & Destructor Documentation

◆ SimulationBackup()

bdm::SimulationBackup::SimulationBackup ( const std::string &  backup_file,
const std::string &  restore_file 
)

If backup_file is an empty string no backups will be made If restore_file is an empty string no restore will be made

Definition at line 19 of file simulation_backup.cc.

Member Function Documentation

◆ Backup()

void bdm::SimulationBackup::Backup ( size_t  completed_simulation_steps)
inline

Definition at line 54 of file simulation_backup.h.

◆ BackupEnabled()

bool bdm::SimulationBackup::BackupEnabled ( )

Definition at line 60 of file simulation_backup.cc.

◆ GetSimulationStepsFromBackup()

size_t bdm::SimulationBackup::GetSimulationStepsFromBackup ( )

Definition at line 42 of file simulation_backup.cc.

◆ Restore()

void bdm::SimulationBackup::Restore ( )
inline

Definition at line 83 of file simulation_backup.h.

◆ RestoreEnabled()

bool bdm::SimulationBackup::RestoreEnabled ( )

Definition at line 62 of file simulation_backup.cc.

Member Data Documentation

◆ after_restore_event_

std::vector< std::function< void()> > bdm::SimulationBackup::after_restore_event_ = {}
static

If a whole simulation is restored from a ROOT file, the new ResourceManager is not updated before the end. Consequently, during restore, a custom streamer cannot access the new RessourceManager. However, they can delay actions that rely on the new RessourceManager by registering it to after_restore_event_ and will be executed after the restore has been finished and the ResourceManager has been updated.

Definition at line 47 of file simulation_backup.h.

◆ backup_

bool bdm::SimulationBackup::backup_ = false
private

Definition at line 118 of file simulation_backup.h.

◆ backup_file

std::string bdm::SimulationBackup::backup_file
private

Definition at line 120 of file simulation_backup.h.

◆ kRuntimeVariableName

const std::string bdm::SimulationBackup::kRuntimeVariableName = "runtime_variable"
static

Definition at line 38 of file simulation_backup.h.

◆ kSimulationName

const std::string bdm::SimulationBackup::kSimulationName = "simulation"
static

Definition at line 36 of file simulation_backup.h.

◆ kSimulationStepName

const std::string bdm::SimulationBackup::kSimulationStepName
static
Initial value:
=
"completed_simulation_steps"

Definition at line 37 of file simulation_backup.h.

◆ restore_

bool bdm::SimulationBackup::restore_ = true
private

Definition at line 119 of file simulation_backup.h.

◆ restore_file

std::string bdm::SimulationBackup::restore_file
private

Definition at line 121 of file simulation_backup.h.


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