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:

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

Member Function Documentation

◆ Backup()

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

Definition at line 54 of file simulation_backup.h.

◆ BackupEnabled()

bool bdm::SimulationBackup::BackupEnabled ( )

Definition at line 60 of file

◆ GetSimulationStepsFromBackup()

size_t bdm::SimulationBackup::GetSimulationStepsFromBackup ( )

Definition at line 42 of file

◆ Restore()

void bdm::SimulationBackup::Restore ( )

Definition at line 83 of file simulation_backup.h.

◆ RestoreEnabled()

bool bdm::SimulationBackup::RestoreEnabled ( )

Definition at line 62 of file

Member Data Documentation

◆ after_restore_event_

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

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

Definition at line 118 of file simulation_backup.h.

◆ backup_file

std::string bdm::SimulationBackup::backup_file

Definition at line 120 of file simulation_backup.h.

◆ kRuntimeVariableName

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

Definition at line 38 of file simulation_backup.h.

◆ kSimulationName

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

Definition at line 36 of file simulation_backup.h.

◆ kSimulationStepName

const std::string bdm::SimulationBackup::kSimulationStepName
Initial value:

Definition at line 37 of file simulation_backup.h.

◆ restore_

bool bdm::SimulationBackup::restore_ = true

Definition at line 119 of file simulation_backup.h.

◆ restore_file

std::string bdm::SimulationBackup::restore_file

Definition at line 121 of file simulation_backup.h.

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