Kanzi Connect  1.1.10
Kanzi Connect C++ API
kanzi::connect::FileTransferEntry< OutputSessionClass > Class Template Referenceabstract

Can handle transferring a file in blocks over connection adapter. More...

#include <file_transfer_entry.hpp>

Public Member Functions

bool done () const
 Has the transfer finished. More...
 
 FileTransferEntry (const string &uri, vector< char > &buffer, unsigned int handle, weak_ptr< OutputSessionClass > session, unsigned int blockSize, unsigned int timeout_ms)
 Constructor. More...
 
unsigned int handle () const
 Get the identification handle of this transfer. More...
 
bool matches (const string &uri, shared_ptr< OutputSessionClass > session) const
 Do the given arguments match this transfer. More...
 
void progress ()
 Progress the transfer by sending one block. More...
 
virtual ~FileTransferEntry ()
 dtor More...
 

Protected Attributes

unsigned int m_blockIndex
 The index of the block that is to be sent. More...
 
unsigned int m_blockSize
 How big is one single block that is transferred on one go (last block may be smaller) More...
 
vector< char > m_buf
 Contains the whole data to send. More...
 
unsigned int m_handle
 Unique identifier for the file so it can be identified by both parties of the transfer (sender and receiver) when there are several blocks. More...
 
vector< char >::iterator m_pos
 The position on the buffer that has been sent. More...
 
unsigned int m_remainingSize
 How many bytes there is still left in the file to be transferred. More...
 
weak_ptr< OutputSessionClass > m_session
 The output which does the actual sending. More...
 
unsigned int m_timeout_ms
 The server will inform the client how long to wait for the entire transaction to complete. More...
 
string m_uri
 The path to the file to be transferred. More...
 

Detailed Description

template<typename OutputSessionClass>
class kanzi::connect::FileTransferEntry< OutputSessionClass >

Can handle transferring a file in blocks over connection adapter.

Constructor & Destructor Documentation

◆ FileTransferEntry()

template<typename OutputSessionClass >
kanzi::connect::FileTransferEntry< OutputSessionClass >::FileTransferEntry ( const string &  uri,
vector< char > &  buffer,
unsigned int  handle,
weak_ptr< OutputSessionClass >  session,
unsigned int  blockSize,
unsigned int  timeout_ms 
)
inline

Constructor.

Parameters
uriIdentifies the file
bufferContains the data to send
handleIdentifies the file transfer when there are multiple blocks being sent
sessionImplements the actual output used to send
blockSizeHow big is one single block that is transferred on one go
timeout_msThe server will inform the client how long to wait for the entire transaction to complete

◆ ~FileTransferEntry()

template<typename OutputSessionClass >
kanzi::connect::FileTransferEntry< OutputSessionClass >::~FileTransferEntry ( )
inlinevirtual

dtor

Member Function Documentation

◆ done()

template<typename OutputSessionClass >
bool kanzi::connect::FileTransferEntry< OutputSessionClass >::done ( ) const
inline

Has the transfer finished.

Returns
True if yes

◆ handle()

template<typename OutputSessionClass >
unsigned int kanzi::connect::FileTransferEntry< OutputSessionClass >::handle ( ) const
inline

Get the identification handle of this transfer.

Returns
the handle

◆ matches()

template<typename OutputSessionClass >
bool kanzi::connect::FileTransferEntry< OutputSessionClass >::matches ( const string &  uri,
shared_ptr< OutputSessionClass >  session 
) const
inline

Do the given arguments match this transfer.

Parameters
uriIdentify the file
sessionThe session which does the transfer

◆ progress()

template<typename OutputSessionClass >
void kanzi::connect::FileTransferEntry< OutputSessionClass >::progress ( )
inline

Progress the transfer by sending one block.

Member Data Documentation

◆ m_blockIndex

template<typename OutputSessionClass >
unsigned int kanzi::connect::FileTransferEntry< OutputSessionClass >::m_blockIndex
protected

The index of the block that is to be sent.

◆ m_blockSize

template<typename OutputSessionClass >
unsigned int kanzi::connect::FileTransferEntry< OutputSessionClass >::m_blockSize
protected

How big is one single block that is transferred on one go (last block may be smaller)

◆ m_buf

template<typename OutputSessionClass >
vector<char> kanzi::connect::FileTransferEntry< OutputSessionClass >::m_buf
protected

Contains the whole data to send.

◆ m_handle

template<typename OutputSessionClass >
unsigned int kanzi::connect::FileTransferEntry< OutputSessionClass >::m_handle
protected

Unique identifier for the file so it can be identified by both parties of the transfer (sender and receiver) when there are several blocks.

◆ m_pos

template<typename OutputSessionClass >
vector<char>::iterator kanzi::connect::FileTransferEntry< OutputSessionClass >::m_pos
protected

The position on the buffer that has been sent.

◆ m_remainingSize

template<typename OutputSessionClass >
unsigned int kanzi::connect::FileTransferEntry< OutputSessionClass >::m_remainingSize
protected

How many bytes there is still left in the file to be transferred.

◆ m_session

template<typename OutputSessionClass >
weak_ptr<OutputSessionClass> kanzi::connect::FileTransferEntry< OutputSessionClass >::m_session
protected

The output which does the actual sending.

◆ m_timeout_ms

template<typename OutputSessionClass >
unsigned int kanzi::connect::FileTransferEntry< OutputSessionClass >::m_timeout_ms
protected

The server will inform the client how long to wait for the entire transaction to complete.

◆ m_uri

template<typename OutputSessionClass >
string kanzi::connect::FileTransferEntry< OutputSessionClass >::m_uri
protected

The path to the file to be transferred.


The documentation for this class was generated from the following file: