SALOME documentation central

Salome_file_i Class Reference

A class to manage file transfer in SALOME. More...

Inheritance diagram for Salome_file_i:
Inheritance graph

Public Member Functions

 Salome_file_i ()
virtual ~Salome_file_i ()
virtual void load (const char *hdf5_file)
virtual void save (const char *hdf5_file)
virtual void save_all (const char *hdf5_file)
virtual void setLocalFile (const char *comp_file_name)
virtual void setDistributedFile (const char *comp_file_name)
virtual void connect (Engines::Salome_file_ptr source_Salome_file)
virtual void connectDistributedFile (const char *file_name, Engines::Salome_file_ptr source_Salome_file)
virtual void setDistributedSourceFile (const char *file_name, const char *source_file_name)
virtual void recvFiles ()
virtual void removeFile (const char *file_name)
virtual void removeFiles ()
virtual void setContainer (Engines::Container_ptr container)
virtual Engines::filesgetFilesInfos ()
virtual Engines::filegetFileInfos (const char *file_name)
virtual Engines::SfStategetSalome_fileState ()
virtual CORBA::Long open (const char *file_name)
virtual void close (CORBA::Long fileId)
virtual Engines::fileBlockgetBlock (CORBA::Long fileId)
 get a data block from a file
CORBA::Long openW (const char *fileName)
 open the given file in write mode (for copy)
void putBlock (CORBA::Long fileId, const Engines::fileBlock &block)
 put a data block for copy into a file

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)
virtual bool getDistributedFile (std::string file_name)

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

Detailed Description

A class to manage file transfer in SALOME.


Constructor & Destructor Documentation

Salome_file_i::Salome_file_i (  ) 

Default constructor,

Salome_file_i::~Salome_file_i (  )  [virtual]

Destructor


Member Function Documentation

void Salome_file_i::load ( const char *  hdf5_file  )  [virtual]

CORBA method

See also:
Engines::Salome_file::load
void Salome_file_i::save ( const char *  hdf5_file  )  [virtual]

CORBA method

See also:
Engines::Salome_file::save
void Salome_file_i::save_all ( const char *  hdf5_file  )  [virtual]

CORBA method

See also:
Engines::Salome_file::save_all
void Salome_file_i::setLocalFile ( const char *  comp_file_name  )  [virtual]

CORBA method

See also:
Engines::Salome_file::setLocalFile
void Salome_file_i::setDistributedFile ( const char *  comp_file_name  )  [virtual]
void Salome_file_i::connect ( Engines::Salome_file_ptr  source_Salome_file  )  [virtual]

CORBA method

See also:
Engines::Salome_file::connect
void Salome_file_i::connectDistributedFile ( const char *  file_name,
Engines::Salome_file_ptr  source_Salome_file 
) [virtual]
void Salome_file_i::setDistributedSourceFile ( const char *  file_name,
const char *  source_file_name 
) [virtual]
void Salome_file_i::recvFiles (  )  [virtual]

CORBA method

See also:
Engines::Salome_file::recvFiles
void Salome_file_i::removeFile ( const char *  file_name  )  [virtual]

CORBA method

See also:
Engines::Salome_file::removeFile
void Salome_file_i::removeFiles (  )  [virtual]

CORBA method

See also:
Engines::Salome_file::removeFiles
Engines::files * Salome_file_i::getFilesInfos (  )  [virtual]

CORBA method

See also:
Engines::Salome_file::getFilesInfos
Engines::file * Salome_file_i::getFileInfos ( const char *  file_name  )  [virtual]

CORBA method

See also:
Engines::Salome_file::getFileInfos
Engines::SfState * Salome_file_i::getSalome_fileState (  )  [virtual]
CORBA::Long Salome_file_i::open ( const char *  file_name  )  [virtual]

CORBA method: try to open the file given. If the file is readable, return a positive integer else return 0;

Parameters:
fileName file name to be transfered
Returns:
fileId = positive integer > 0 if open OK.

Reimplemented from fileTransfer_i.

void Salome_file_i::close ( CORBA::Long  fileId  )  [virtual]

CORBA method: close the file associated to the fileId given at open.

Parameters:
fileId got in return from open method

Reimplemented from fileTransfer_i.

Engines::fileBlock * Salome_file_i::getBlock ( CORBA::Long  fileId  )  [virtual]

get a data block from a file

CORBA method: get a block of data from the file associated to the fileId given at open.

Parameters:
fileId got in return from open method
Returns:
an octet sequence. Last one is empty.

Reimplemented from fileTransfer_i.

bool Salome_file_i::checkLocalFile ( std::string  file_name  )  [protected, virtual]

local C++ method : This method is used by revFiles to check if a local managed file is ok.

Parameters:
fileName name of the file
bool Salome_file_i::getDistributedFile ( std::string  file_name  )  [protected, virtual]

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.

Parameters:
fileName name of the file
CORBA::Long fileTransfer_i::openW ( const char *  fileName  )  [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;

Parameters:
fileName path to the file to be transfered
Returns:
fileId = positive integer > 0 if open OK.
void fileTransfer_i::putBlock ( CORBA::Long  fileId,
const Engines::fileBlock block 
) [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.

Parameters:
fileId got in return from openW method
block an octet sequence to copy into opened file

Copyright © 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS