mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 05:07:54 +00:00
#776 default restore_stls to false
This commit is contained in:
parent
7f7adca0ac
commit
9be53ebb9b
@ -370,7 +370,7 @@ namespace Trick {
|
|||||||
Restore a checkpoint from the given stream.
|
Restore a checkpoint from the given stream.
|
||||||
@param in_s - input stream.
|
@param in_s - input stream.
|
||||||
*/
|
*/
|
||||||
int read_checkpoint( std::istream* in_s, bool do_restore_stls=true);
|
int read_checkpoint( std::istream* in_s, bool do_restore_stls=false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Read a checkpoint from the file of the given name.
|
Read a checkpoint from the file of the given name.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "trick/MemoryManager.hh"
|
#include "trick/MemoryManager.hh"
|
||||||
#include "trick/ClassicCheckPointAgent.hh"
|
#include "trick/ClassicCheckPointAgent.hh"
|
||||||
|
|
||||||
int Trick::MemoryManager::read_checkpoint( std::istream *is, bool do_restore_stls /* default is true */) {
|
int Trick::MemoryManager::read_checkpoint( std::istream *is, bool do_restore_stls /* default is false */) {
|
||||||
|
|
||||||
ALLOC_INFO_MAP::iterator pos;
|
ALLOC_INFO_MAP::iterator pos;
|
||||||
ALLOC_INFO* alloc_info;
|
ALLOC_INFO* alloc_info;
|
||||||
@ -22,8 +22,10 @@ int Trick::MemoryManager::read_checkpoint( std::istream *is, bool do_restore_stl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Search for stls and restore them
|
// Search for stls and restore them
|
||||||
for ( pos=alloc_info_map.begin() ; do_restore_stls && pos!=alloc_info_map.end() ; pos++ ) {
|
if(do_restore_stls) {
|
||||||
restore_stls(pos->second) ;
|
for ( pos=alloc_info_map.begin() ; pos!=alloc_info_map.end() ; pos++ ) {
|
||||||
|
restore_stls(pos->second) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go through all of the allocations that have been created looking
|
// Go through all of the allocations that have been created looking
|
||||||
@ -62,10 +64,10 @@ int Trick::MemoryManager::read_checkpoint(const char* filename ) {
|
|||||||
std::ifstream infile(filename , std::ios::in);
|
std::ifstream infile(filename , std::ios::in);
|
||||||
if (infile.is_open()) {
|
if (infile.is_open()) {
|
||||||
|
|
||||||
// If the file extention is .dat, we will tell read_checkpoint not to
|
// If the filename is not S_default.dat, we will tell read_checkpoint to
|
||||||
// restore stls. It is not necessary and time consuming.
|
// restore stls.
|
||||||
bool do_restore_stls =
|
bool do_restore_stls =
|
||||||
(std::string(filename).find(".dat") != std::string::npos);
|
(std::string(filename).find("S_default.dat") == std::string::npos);
|
||||||
|
|
||||||
return ( read_checkpoint( &infile, do_restore_stls )) ;
|
return ( read_checkpoint( &infile, do_restore_stls )) ;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user