{
MESSAGE("Engines_Container_i::Shutdown()");
+ // Clear registered temporary files
+ clearTemporaryFiles();
+
/* For each component contained in this container
* tell it to self-destroy
*/
}
return found;
}
+
+void Engines_Container_i::registerTemporaryFile( const std::string& fileName )
+{
+ _tmp_files.remove( fileName );
+ _tmp_files.push_back( fileName );
+}
+
+void Engines_Container_i::unregisterTemporaryFile( const std::string& fileName )
+{
+ _tmp_files.remove( fileName );
+}
+
+void Engines_Container_i::clearTemporaryFiles()
+{
+ std::list<std::string>::const_iterator it;
+ for ( it = _tmp_files.begin(); it != _tmp_files.end(); ++it ) {
+#ifdef WIN32
+ std::string command = "del /F ";
+#else
+ std::string command = "rm -f ";
+#endif
+ command += *it;
+ system( command.c_str() );
+ }
+ _tmp_files.clear();
+}
#include <sys/types.h>
#include <omnithread.h>
#include <map>
+#include <list>
#include <string>
class SALOME_NamingService;
int getArgc() { return _argc; }
char **getArgv() { return _argv; }
+ void registerTemporaryFile( const std::string& fileName );
+ void unregisterTemporaryFile( const std::string& fileName );
+ void clearTemporaryFiles();
+
protected:
static std::map<std::string, int> _cntInstances_map;
std::map<std::string,Engines::EngineComponent_var> _listInstances_map;
std::map<std::string,Engines::fileRef_var> _fileRef_map;
std::map<std::string,Engines::Salome_file_var> _Salome_file_map;
+ std::list<std::string> _tmp_files;
Engines::fileTransfer_var _fileTransfer;
int _argc ;