ACE_Asynch_Transmit_File::Header_And_Trailer Class Reference

The class defines a data structure that contains pointers to data to send before and after the file data is sent. More...

#include <Asynch_IO.h>

Collaboration diagram for ACE_Asynch_Transmit_File::Header_And_Trailer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Header_And_Trailer (ACE_Message_Block *header=0, size_t header_bytes=0, ACE_Message_Block *trailer=0, size_t trailer_bytes=0)
 Constructor.

virtual ~Header_And_Trailer (void)
 Destructor.

void header_and_trailer (ACE_Message_Block *header=0, size_t header_bytes=0, ACE_Message_Block *trailer=0, size_t trailer_bytes=0)
 This method allows all the member to be set in one fell swoop.

ACE_Message_Blockheader (void) const
 Get header which goes before the file data.

void header (ACE_Message_Block *message_block)
 Set header which goes before the file data.

size_t header_bytes (void) const
 Get size of the header data.

void header_bytes (size_t bytes)
 Set size of the header data.

ACE_Message_Blocktrailer (void) const
 Get trailer which goes after the file data.

void trailer (ACE_Message_Block *message_block)
 Set trailer which goes after the file data.

size_t trailer_bytes (void) const
 Get size of the trailer data.

void trailer_bytes (size_t bytes)
 Set size of the trailer data.

ACE_LPTRANSMIT_FILE_BUFFERS transmit_buffers (void)
 Conversion routine.


Protected Attributes

ACE_Message_Blockheader_
 Header data.

size_t header_bytes_
 Size of header data.

ACE_Message_Blocktrailer_
 Trailer data.

size_t trailer_bytes_
 Size of trailer data.

ACE_TRANSMIT_FILE_BUFFERS transmit_buffers_
 Target data structure.


Detailed Description

The class defines a data structure that contains pointers to data to send before and after the file data is sent.

This class provides a wrapper over TRANSMIT_FILE_BUFFERS and provided a consistent use of ACE_Message_Blocks.

Definition at line 1175 of file Asynch_IO.h.


Constructor & Destructor Documentation

ACE_Asynch_Transmit_File::Header_And_Trailer::Header_And_Trailer ACE_Message_Block header = 0,
size_t  header_bytes = 0,
ACE_Message_Block trailer = 0,
size_t  trailer_bytes = 0
 

Constructor.

Definition at line 863 of file Asynch_IO.cpp.

00867   : header_ (header),
00868     header_bytes_ (header_bytes),
00869     trailer_ (trailer),
00870     trailer_bytes_ (trailer_bytes)
00871 {
00872 }

ACE_Asynch_Transmit_File::Header_And_Trailer::~Header_And_Trailer void   )  [virtual]
 

Destructor.

Definition at line 874 of file Asynch_IO.cpp.

00875 {
00876 }


Member Function Documentation

void ACE_Asynch_Transmit_File::Header_And_Trailer::header ACE_Message_Block message_block  ) 
 

Set header which goes before the file data.

Definition at line 897 of file Asynch_IO.cpp.

References header_.

00898 {
00899   this->header_ = message_block;
00900 }

ACE_Message_Block * ACE_Asynch_Transmit_File::Header_And_Trailer::header void   )  const
 

Get header which goes before the file data.

Definition at line 891 of file Asynch_IO.cpp.

References header_.

Referenced by header_and_trailer().

00892 {
00893   return this->header_;
00894 }

void ACE_Asynch_Transmit_File::Header_And_Trailer::header_and_trailer ACE_Message_Block header = 0,
size_t  header_bytes = 0,
ACE_Message_Block trailer = 0,
size_t  trailer_bytes = 0
 

This method allows all the member to be set in one fell swoop.

Definition at line 879 of file Asynch_IO.cpp.

References header(), header_bytes(), trailer(), and trailer_bytes().

00883 {
00884   this->header (header);
00885   this->header_bytes (header_bytes);
00886   this->trailer (trailer);
00887   this->trailer_bytes (trailer_bytes);
00888 }

void ACE_Asynch_Transmit_File::Header_And_Trailer::header_bytes size_t  bytes  ) 
 

Set size of the header data.

Definition at line 909 of file Asynch_IO.cpp.

References header_bytes_.

00910 {
00911   this->header_bytes_ = bytes;
00912 }

size_t ACE_Asynch_Transmit_File::Header_And_Trailer::header_bytes void   )  const
 

Get size of the header data.

Definition at line 903 of file Asynch_IO.cpp.

References header_bytes_.

Referenced by header_and_trailer(), and ACE_POSIX_Asynch_Transmit_Handler::transmit().

00904 {
00905   return this->header_bytes_;
00906 }

void ACE_Asynch_Transmit_File::Header_And_Trailer::trailer ACE_Message_Block message_block  ) 
 

Set trailer which goes after the file data.

Definition at line 921 of file Asynch_IO.cpp.

References trailer_.

00922 {
00923   this->trailer_ = message_block;
00924 }

ACE_Message_Block * ACE_Asynch_Transmit_File::Header_And_Trailer::trailer void   )  const
 

Get trailer which goes after the file data.

Definition at line 915 of file Asynch_IO.cpp.

References trailer_.

Referenced by header_and_trailer().

00916 {
00917   return this->trailer_;
00918 }

void ACE_Asynch_Transmit_File::Header_And_Trailer::trailer_bytes size_t  bytes  ) 
 

Set size of the trailer data.

Definition at line 933 of file Asynch_IO.cpp.

References trailer_bytes_.

00934 {
00935   this->trailer_bytes_ = bytes;
00936 }

size_t ACE_Asynch_Transmit_File::Header_And_Trailer::trailer_bytes void   )  const
 

Get size of the trailer data.

Definition at line 927 of file Asynch_IO.cpp.

References trailer_bytes_.

Referenced by header_and_trailer(), and ACE_POSIX_Asynch_Transmit_Handler::initiate_read_file().

00928 {
00929   return this->trailer_bytes_;
00930 }

ACE_LPTRANSMIT_FILE_BUFFERS ACE_Asynch_Transmit_File::Header_And_Trailer::transmit_buffers void   ) 
 

Conversion routine.

Definition at line 939 of file Asynch_IO.cpp.

References header_, header_bytes_, ACE_Message_Block::rd_ptr(), trailer_, trailer_bytes_, and transmit_buffers_.

Referenced by ACE_WIN32_Asynch_Transmit_File::transmit_file().

00940 {
00941   // If both are zero, return zero
00942   if (this->header_ == 0 && this->trailer_ == 0)
00943     return 0;
00944   else
00945     {
00946       // Something is valid
00947 
00948       // If header is valid, set the fields
00949       if (this->header_ != 0)
00950         {
00951           this->transmit_buffers_.Head = this->header_->rd_ptr ();
00952 #if defined(ACE_WIN64)
00953           this->transmit_buffers_.HeadLength =
00954             static_cast<DWORD> (this->header_bytes_);
00955 #else
00956           this->transmit_buffers_.HeadLength = this->header_bytes_;
00957 #endif /* ACE_WIN64 */
00958         }
00959       else
00960         {
00961           this->transmit_buffers_.Head = 0;
00962           this->transmit_buffers_.HeadLength = 0;
00963         }
00964 
00965       // If trailer is valid, set the fields
00966       if (this->trailer_ != 0)
00967         {
00968           this->transmit_buffers_.Tail = this->trailer_->rd_ptr ();
00969 #if defined(ACE_WIN64)
00970           this->transmit_buffers_.TailLength =
00971             static_cast<DWORD> (this->trailer_bytes_);
00972 #else
00973           this->transmit_buffers_.TailLength = this->trailer_bytes_;
00974 #endif /* ACE_WIN64 */
00975         }
00976       else
00977         {
00978           this->transmit_buffers_.Tail = 0;
00979           this->transmit_buffers_.TailLength = 0;
00980         }
00981 
00982       // Return the transmit buffers
00983       return &this->transmit_buffers_;
00984     }
00985 }


Member Data Documentation

ACE_Message_Block* ACE_Asynch_Transmit_File::Header_And_Trailer::header_ [protected]
 

Header data.

Definition at line 1223 of file Asynch_IO.h.

Referenced by header(), and transmit_buffers().

size_t ACE_Asynch_Transmit_File::Header_And_Trailer::header_bytes_ [protected]
 

Size of header data.

Definition at line 1226 of file Asynch_IO.h.

Referenced by header_bytes(), and transmit_buffers().

ACE_Message_Block* ACE_Asynch_Transmit_File::Header_And_Trailer::trailer_ [protected]
 

Trailer data.

Definition at line 1229 of file Asynch_IO.h.

Referenced by trailer(), and transmit_buffers().

size_t ACE_Asynch_Transmit_File::Header_And_Trailer::trailer_bytes_ [protected]
 

Size of trailer data.

Definition at line 1232 of file Asynch_IO.h.

Referenced by trailer_bytes(), and transmit_buffers().

ACE_TRANSMIT_FILE_BUFFERS ACE_Asynch_Transmit_File::Header_And_Trailer::transmit_buffers_ [protected]
 

Target data structure.

Definition at line 1235 of file Asynch_IO.h.

Referenced by transmit_buffers().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:19:48 2006 for ACE by doxygen 1.3.6