A class to manage file transfer in SALOME. More...
#include <Salome_file_i.hxx>
Public Member Functions | |
Salome_file_i () | |
Default constructor,. More... | |
virtual | ~Salome_file_i () |
Destructor. More... | |
virtual void | load (const char *hdf5_file) |
CORBA method. More... | |
virtual void | save (const char *hdf5_file) |
CORBA method. More... | |
virtual void | save_all (const char *hdf5_file) |
CORBA method. More... | |
virtual void | setLocalFile (const char *comp_file_name) |
CORBA method. More... | |
virtual void | setDistributedFile (const char *comp_file_name) |
CORBA method. More... | |
virtual void | connect (Engines::Salome_file_ptr source_Salome_file) |
CORBA method. More... | |
virtual void | connectDistributedFile (const char *file_name, Engines::Salome_file_ptr source_Salome_file) |
CORBA method. More... | |
virtual void | setDistributedSourceFile (const char *file_name, const char *source_file_name) |
CORBA method. More... | |
virtual void | recvFiles () |
CORBA method. More... | |
virtual void | removeFile (const char *file_name) |
CORBA method. More... | |
virtual void | removeFiles () |
CORBA method. More... | |
virtual void | setContainer (Engines::Container_ptr container) |
virtual Engines::files * | getFilesInfos () |
CORBA method. More... | |
virtual Engines::file * | getFileInfos (const char *file_name) |
CORBA method. More... | |
virtual Engines::SfState * | getSalome_fileState () |
CORBA method. More... | |
virtual CORBA::Long | open (const char *file_name) |
CORBA method: try to open the file given. More... | |
virtual void | close (CORBA::Long fileId) |
CORBA method: close the file associated to the fileId given at open. More... | |
virtual Engines::fileBlock * | getBlock (CORBA::Long fileId) |
CORBA::Long | openW (const char *fileName) |
open the given file in write mode (for copy) More... | |
void | putBlock (CORBA::Long fileId, const Engines::fileBlock &block) |
put a data block for copy into a file More... | |
virtual PortableServer::POA_ptr | _default_POA () |
Get default POA for the servant object. More... | |
virtual void | Register () |
Increment reference counter. More... | |
virtual void | UnRegister () |
Decrement reference counter. More... | |
virtual void | Destroy () |
Decrement reference counter. More... | |
Protected Types | |
typedef std::map< int, FILE * > | _t_fileAccess |
typedef std::map< std::string, Engines::file > | _t_fileManaged |
typedef std::map< std::string, Engines::Salome_file_var > | _t_fileDistributedSource |
Protected Member Functions | |
virtual bool | checkLocalFile (std::string file_name) |
local C++ method : This method is used by revFiles to check if a local managed file is ok. More... | |
virtual bool | getDistributedFile (std::string file_name) |
local C++ method : this method is used by recvFiles to get a distributed file from is distributed source. More... | |
Protected Attributes | |
int | _fileId |
long | _path_max |
_t_fileAccess | _fileAccess |
_t_fileManaged | _fileManaged |
_t_fileDistributedSource | _fileDistributedSource |
Engines::SfState | _state |
Engines::Container_ptr | _container |
Engines::Salome_file_var | _default_source_Salome_file |
int | _fileKey |
int | _ctr |
PortableServer::POA_var | myPOA |
int | myRefCounter |
A class to manage file transfer in SALOME.
|
protected |
|
protected |
|
protected |
Salome_file_i::Salome_file_i | ( | ) |
Default constructor,.
References _container, _default_source_Salome_file, _fileId, _path_max, _state, Engines::SfState::files_ok, Engines::SfState::hdf5_file_name, Engines::SfState::name, and Engines::SfState::number_of_files.
|
virtual |
Destructor.
|
virtualinherited |
Get default POA for the servant object.
This function is implicitly called from "_this()" function. Default POA can be set via the constructor.
References SALOME::GenericObj_i::myPOA.
|
protectedvirtual |
local C++ method : This method is used by revFiles to check if a local managed file is ok.
fileName | name of the file |
References _fileManaged, and INFOS.
Referenced by recvFiles(), and Parallel_Salome_file_i::recvFiles_node().
|
virtual |
CORBA method: close the file associated to the fileId given at open.
fileId | got in return from open method |
References _fileAccess, INFOS, and MESSAGE.
Referenced by load().
|
virtual |
CORBA method.
Reimplemented in Parallel_Salome_file_i.
References _default_source_Salome_file, _fileDistributedSource, _fileManaged, SALOME::INTERNAL_ERROR, SALOME::ExceptionStruct::text, and SALOME::ExceptionStruct::type.
Referenced by Parallel_Salome_file_i::connect().
|
virtual |
CORBA method.
Reimplemented in Parallel_Salome_file_i.
References _fileDistributedSource, _fileManaged, SALOME::INTERNAL_ERROR, SALOME::ExceptionStruct::text, and SALOME::ExceptionStruct::type.
Referenced by Parallel_Salome_file_i::connectDistributedFile(), and main().
|
virtualinherited |
Decrement reference counter.
References MESSAGE, and SALOME::GenericObj_i::UnRegister().
|
virtual |
References _fileAccess, FILEBLOCK_SIZE, and INFOS.
|
protectedvirtual |
local C++ method : this method is used by recvFiles to get a distributed file from is distributed source.
If there is no source_file_name for the file, it tries to get the file from the source. In this case, the source distributed file has to managed only one file to be able to the send the file.
fileName | name of the file |
References _fileDistributedSource, _fileManaged, ASSERT, INFOS, and MESSAGE.
Referenced by recvFiles(), and Parallel_Salome_file_i::recvFiles_node().
|
virtual |
CORBA method.
References _fileManaged, SALOME::INTERNAL_ERROR, SALOME::ExceptionStruct::text, and SALOME::ExceptionStruct::type.
Referenced by main().
|
virtual |
|
virtual |
|
virtual |
CORBA method.
Reimplemented in Parallel_Salome_file_i.
References _container, _fileManaged, _path_max, _state, close(), HDFdataset::CloseOnDisk(), Engines::file::container, Engines::file::file_name, Engines::SfState::files_ok, HDFdataset::GetSize(), Engines::SfState::hdf5_file_name, HDF_RDONLY, SALOME::INTERNAL_ERROR, Engines::file::node, Engines::SfState::number_of_files, open(), HDFfile::OpenOnDisk(), HDFgroup::OpenOnDisk(), HDFdataset::OpenOnDisk(), Engines::file::path, HDFdataset::ReadFromDisk(), Engines::file::source_file_name, Engines::file::status, SALOME::ExceptionStruct::text, SALOME::ExceptionStruct::type, and Engines::file::type.
Referenced by main().
|
virtual |
CORBA method: try to open the file given.
If the file is readable, return a positive integer else return 0;
fileName | file name to be transfered |
References _fileAccess, _fileId, _fileManaged, INFOS, and MESSAGE.
Referenced by load().
|
inherited |
open the given file in write mode (for copy)
CORBA method: try to open the file. If the file is writable, return a positive integer else return 0;
fileName | path to the file to be transfered |
References fileTransfer_i::_ctr, fileTransfer_i::_fileAccess, fileTransfer_i::_fileKey, INFOS, and MESSAGE.
|
inherited |
put a data block for copy into a file
CORBA method: put a block of data into the file associated to the fileId given at openW.
fileId | got in return from openW method |
block | an octet sequence to copy into opened file |
References fileTransfer_i::_fileAccess, INFOS, MESSAGE, and SCRUTE.
|
virtual |
CORBA method.
Reimplemented in Parallel_Salome_file_i.
References _fileManaged, _state, checkLocalFile(), Engines::file::file_name, Engines::SfState::files_ok, getDistributedFile(), SALOME::INTERNAL_ERROR, Engines::file::status, SALOME::ExceptionStruct::text, SALOME::ExceptionStruct::type, and Engines::file::type.
Referenced by Engines_Component_i::checkInputFilesToService(), Engines_Component_i::checkOutputFilesToService(), Engines_Container_i::createSalome_file(), Engines_Parallel_Container_i::createSalome_file(), and main().
|
virtualinherited |
Increment reference counter.
References IS_OBJ_IN_QUESTION, MESSAGE, MYDEBUG, and SALOME::GenericObj_i::myRefCounter.
|
virtual |
|
virtual |
|
virtual |
CORBA method.
Reimplemented in Parallel_Salome_file_i.
References _fileManaged, _state, HDFfile::CloseOnDisk(), HDFgroup::CloseOnDisk(), HDFfile::CreateOnDisk(), HDFgroup::CreateOnDisk(), Engines::file::file_name, Engines::SfState::hdf5_file_name, HDF_STRING, SALOME::INTERNAL_ERROR, Engines::file::path, Engines::file::source_file_name, Engines::file::status, SALOME::ExceptionStruct::text, SALOME::ExceptionStruct::type, and Engines::file::type.
Referenced by main().
|
virtual |
CORBA method.
Reimplemented in Parallel_Salome_file_i.
References _fileManaged, _state, HDFfile::CloseOnDisk(), HDFgroup::CloseOnDisk(), HDFfile::CreateOnDisk(), HDFgroup::CreateOnDisk(), Engines::file::file_name, Engines::SfState::files_ok, HDFConvert::FromAscii(), Engines::SfState::hdf5_file_name, HDF_STRING, SALOME::INTERNAL_ERROR, Engines::file::path, Engines::file::source_file_name, Engines::file::status, SALOME::ExceptionStruct::text, SALOME::ExceptionStruct::type, and Engines::file::type.
Referenced by main().
|
virtual |
Reimplemented in Parallel_Salome_file_i.
References _container, and _fileManaged.
Referenced by Engines_Container_i::createSalome_file(), Engines_Component_i::setInputFileToService(), and Engines_Component_i::setOutputFileToService().
|
virtual |
CORBA method.
References _container, _default_source_Salome_file, _fileDistributedSource, _fileManaged, _path_max, _state, Engines::file::container, Engines::file::file_name, Engines::SfState::files_ok, SALOME::INTERNAL_ERROR, Engines::file::node, Engines::SfState::number_of_files, Engines::file::path, Engines::file::source_file_name, Engines::file::status, SALOME::ExceptionStruct::text, SALOME::ExceptionStruct::type, and Engines::file::type.
Referenced by main().
|
virtual |
CORBA method.
Reimplemented in Parallel_Salome_file_i.
References _fileManaged, SALOME::INTERNAL_ERROR, SALOME::ExceptionStruct::text, and SALOME::ExceptionStruct::type.
Referenced by Parallel_Salome_file_i::setDistributedSourceFile().
|
virtual |
CORBA method.
References _container, _fileManaged, _path_max, _state, Engines::file::container, Engines::file::file_name, Engines::SfState::files_ok, SALOME::INTERNAL_ERROR, Engines::file::node, Engines::SfState::number_of_files, Engines::file::path, Engines::file::source_file_name, Engines::file::status, SALOME::ExceptionStruct::text, SALOME::ExceptionStruct::type, and Engines::file::type.
Referenced by Engines_Container_i::createSalome_file(), Engines_Parallel_Container_i::createSalome_file(), and main().
|
virtualinherited |
Decrement reference counter.
As soon as reference counter goes to zero, the object is automatically deactivated.
References IS_OBJ_IN_QUESTION, MESSAGE, MYDEBUG, SALOME::GenericObj_i::myPOA, and SALOME::GenericObj_i::myRefCounter.
Referenced by SALOME::GenericObj_i::Destroy().
|
protected |
|
protectedinherited |
Referenced by fileTransfer_i::open(), and fileTransfer_i::openW().
|
protected |
Referenced by connect(), Salome_file_i(), and setDistributedFile().
|
protected |
Referenced by close(), getBlock(), and open().
|
protected |
|
protected |
Referenced by open(), and Salome_file_i().
|
protectedinherited |
Referenced by fileTransfer_i::fileTransfer_i(), fileTransfer_i::open(), and fileTransfer_i::openW().
|
protected |
Referenced by checkLocalFile(), connect(), Parallel_Salome_file_i::connect(), connectDistributedFile(), Parallel_Salome_file_i::connectDistributedFile(), getDistributedFile(), getFileInfos(), Parallel_Salome_file_i::getFileNode(), getFilesInfos(), Parallel_Salome_file_i::getParallelDistributedFile(), load(), open(), recvFiles(), Parallel_Salome_file_i::recvFiles_node(), save(), save_all(), Parallel_Salome_file_i::setContainer(), setContainer(), setDistributedFile(), setDistributedSourceFile(), Parallel_Salome_file_i::setDistributedSourceFile(), Parallel_Salome_file_i::setFileNode(), setLocalFile(), and Parallel_Salome_file_i::updateFile().
|
protected |
Referenced by load(), Salome_file_i(), setDistributedFile(), and setLocalFile().
|
protected |
Referenced by getSalome_fileState(), load(), Parallel_Salome_file_i::recvFiles(), recvFiles(), Salome_file_i(), save(), save_all(), setDistributedFile(), and setLocalFile().
|
protectedinherited |
|
protectedinherited |
Referenced by SALOME::GenericObj_i::Register(), and SALOME::GenericObj_i::UnRegister().