Version: 8.3.0
fileTransfer_i Class Reference

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

#include <SALOME_FileTransfer_i.hxx>

Inheritance diagram for fileTransfer_i:

Public Member Functions

 fileTransfer_i ()
 Default constructor,. More...
 
virtual ~fileTransfer_i ()
 Destructor. More...
 
CORBA::Long open (const char *fileName)
 open the given file More...
 
void close (CORBA::Long fileId)
 close a file More...
 
Engines::fileBlockgetBlock (CORBA::Long fileId)
 get a data block from a file More...
 
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 Attributes

int _fileKey
 
std::map< int, FILE * > _fileAccess
 
int _ctr
 
PortableServer::POA_var myPOA
 
int myRefCounter
 

Detailed Description

A class to manage file transfer in SALOME.

Constructor & Destructor Documentation

fileTransfer_i::fileTransfer_i ( )

Default constructor,.

References _fileKey, and MESSAGE.

fileTransfer_i::~fileTransfer_i ( )
virtual

Destructor.

References MESSAGE.

Member Function Documentation

PortableServer::POA_ptr SALOME::GenericObj_i::_default_POA ( )
virtualinherited

Get default POA for the servant object.

This function is implicitly called from "_this()" function. Default POA can be set via the constructor.

Returns
reference to the default POA for the servant

References SALOME::GenericObj_i::myPOA.

void fileTransfer_i::close ( CORBA::Long  fileId)

close a file

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

Parameters
fileIdgot in return from open method

References _fileAccess, INFOS, and MESSAGE.

void SALOME::GenericObj_i::Destroy ( )
virtualinherited

Decrement reference counter.

Deprecated:
Use UnRegister() instead.

References MESSAGE, and SALOME::GenericObj_i::UnRegister().

Engines::fileBlock * fileTransfer_i::getBlock ( CORBA::Long  fileId)

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
fileIdgot in return from open method
Returns
an octet sequence. Last one is empty.

References _fileAccess, FILEBLOCK_SIZE, and INFOS.

CORBA::Long fileTransfer_i::open ( const char fileName)

open the given file

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

Parameters
fileNamepath to the file to be transfered
Returns
fileId = positive integer > 0 if open OK.

References _ctr, _fileAccess, _fileKey, INFOS, and MESSAGE.

CORBA::Long fileTransfer_i::openW ( const char fileName)

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
fileNamepath to the file to be transfered
Returns
fileId = positive integer > 0 if open OK.

References _ctr, _fileAccess, _fileKey, INFOS, and MESSAGE.

void fileTransfer_i::putBlock ( CORBA::Long  fileId,
const Engines::fileBlock block 
)

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
fileIdgot in return from openW method
blockan octet sequence to copy into opened file

References _fileAccess, INFOS, MESSAGE, and SCRUTE.

void SALOME::GenericObj_i::Register ( )
virtualinherited

Increment reference counter.

References IS_OBJ_IN_QUESTION, MESSAGE, MYDEBUG, and SALOME::GenericObj_i::myRefCounter.

void SALOME::GenericObj_i::UnRegister ( )
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().

Field Documentation

int fileTransfer_i::_ctr
protected

Referenced by open(), and openW().

std::map<int, FILE* > fileTransfer_i::_fileAccess
protected

Referenced by close(), getBlock(), open(), openW(), and putBlock().

int fileTransfer_i::_fileKey
protected

Referenced by fileTransfer_i(), open(), and openW().

PortableServer::POA_var SALOME::GenericObj_i::myPOA
protectedinherited
int SALOME::GenericObj_i::myRefCounter
protectedinherited