MoCSI API Reference
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SnapshotLoader< T > Class Template Reference

Class which loads snapshot files and writes their data to the inis and fields. Loads any file created with the SnapshotCreator which has "MoCSI_snapshot" as part of its file name. Offers the option to not load simulation config and/or module ini file data. More...

#include <SnapshotLoader.h>

Collaboration diagram for SnapshotLoader< T >:
Collaboration graph

Public Member Functions

 SnapshotLoader (SimulationClassBase< T > *sim)
 Constructor of the SnapshotLoader.
 
void overwriteSimFields (SimulationClassBase< T > *sim)
 Overwrites the fields in sim with the ones from the snapshot.
 
void overwriteIniFiles (SimulationClassBase< T > *sim, std::vector< std::shared_ptr< GenericManagingModule< T > > > &all_modules, std::vector< std::shared_ptr< GenericSubmodule< T > > > &all_submodules)
 Overwrites the content of the module ini files within each module. Throws an error, if a module that was present in the snapshot is absent in the currently loaded modules.
 
void overwriteSimConfig (SimulationClassBase< T > *sim)
 Overwrite the simulation config data (default.ini + user supplied run ini).
 

Detailed Description

template<typename T>
class SnapshotLoader< T >

Class which loads snapshot files and writes their data to the inis and fields. Loads any file created with the SnapshotCreator which has "MoCSI_snapshot" as part of its file name. Offers the option to not load simulation config and/or module ini file data.

Constructor & Destructor Documentation

◆ SnapshotLoader()

Constructor of the SnapshotLoader.

Parameters
simThe pointer to the sim class, as we need to access the base simulation config.

Member Function Documentation

◆ overwriteIniFiles()

template<typename T >
void SnapshotLoader< T >::overwriteIniFiles ( SimulationClassBase< T > *  sim,
std::vector< std::shared_ptr< GenericManagingModule< T > > > &  all_modules,
std::vector< std::shared_ptr< GenericSubmodule< T > > > &  all_submodules 
)

Overwrites the content of the module ini files within each module. Throws an error, if a module that was present in the snapshot is absent in the currently loaded modules.

Parameters
simThe pointer to the sim class.
all_modulesThe vector containing the pointers to all loaded modules.
all_submodulesThe vector containing the pointers to all loaded submodules.

◆ overwriteSimConfig()

template<typename T >
void SnapshotLoader< T >::overwriteSimConfig ( SimulationClassBase< T > *  sim)

Overwrite the simulation config data (default.ini + user supplied run ini).

Parameters
simThe pointer to the sim class.

◆ overwriteSimFields()

template<typename T >
void SnapshotLoader< T >::overwriteSimFields ( SimulationClassBase< T > *  sim)

Overwrites the fields in sim with the ones from the snapshot.

Parameters
simThe pointer to sim class.

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