file_transfer_header Class Reference

describes one portion of an ongoing file transfer. More...

#include <heavy_file_ops.h>

Inheritance diagram for file_transfer_header:

Inheritance graph
[legend]
Collaboration diagram for file_transfer_header:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 file_transfer_header ()
virtual void pack (byte_array &packed_form) const
 Creates a packed form of the packable object in "packed_form".
virtual bool unpack (byte_array &packed_form)
 Restores the packable from the "packed_form".
virtual int packed_size () const
 Estimates the space needed for the packed structure.
istring text_form () const

Public Attributes

istring _filename
 the name of the file being transferred.
double _byte_start
 the starting location in the file being sent.
int _length
 the length of the transferred piece.

Detailed Description

describes one portion of an ongoing file transfer.

this is just a header describing an attached byte package. it is expected that the bytes follow this in the communication stream.

Definition at line 99 of file heavy_file_ops.h.


Constructor & Destructor Documentation

file_transfer_header::file_transfer_header (  ) 

Definition at line 35 of file heavy_file_ops.cpp.


Member Function Documentation

void file_transfer_header::pack ( byte_array packed_form  )  const [virtual]

Creates a packed form of the packable object in "packed_form".

This must append to the data in "packed_form" rather than clearing prior contents.

Implements packable.

Definition at line 48 of file heavy_file_ops.cpp.

References _byte_start, _filename, _length, basis::attach(), and istring::pack().

Referenced by heavy_file_operations::buffer_files().

bool file_transfer_header::unpack ( byte_array packed_form  )  [virtual]

Restores the packable from the "packed_form".

This object becomes the unpacked form, and therefore must lose any of its prior contents that depend on the data in "packed_form". This is up to the derived unpack function to figure out. The "packed_form" is modified by extracting all of the pieces that are used for this object; the remainder stays in "packed_form". true is returned if the unpacking was successful.

Implements packable.

Definition at line 55 of file heavy_file_ops.cpp.

References _byte_start, _filename, _length, basis::detach(), and istring::unpack().

int file_transfer_header::packed_size (  )  const [virtual]

Estimates the space needed for the packed structure.

Reimplemented from packable.

Definition at line 63 of file heavy_file_ops.cpp.

References _filename, and istring::length().

Referenced by heavy_file_operations::buffer_files().

istring file_transfer_header::text_form (  )  const

Definition at line 42 of file heavy_file_ops.cpp.

References _byte_start, _filename, and _length.


Member Data Documentation

istring file_transfer_header::_filename

the name of the file being transferred.

Definition at line 102 of file heavy_file_ops.h.

Referenced by advance(), heavy_file_operations::buffer_files(), pack(), packed_size(), text_form(), and unpack().

double file_transfer_header::_byte_start

the starting location in the file being sent.

Definition at line 103 of file heavy_file_ops.h.

Referenced by advance(), heavy_file_operations::buffer_files(), pack(), text_form(), and unpack().

int file_transfer_header::_length

the length of the transferred piece.

Definition at line 104 of file heavy_file_ops.h.

Referenced by advance(), heavy_file_operations::buffer_files(), pack(), text_form(), and unpack().


The documentation for this class was generated from the following files:
Generated on Fri Aug 29 04:30:30 2008 for HOOPLE Libraries by  doxygen 1.5.1