Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 Methods

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

virtual ~Header_And_Trailer (void)
 Destructor. More...

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. More...

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

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

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

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

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

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

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

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

ACE_LPTRANSMIT_FILE_BUFFERS transmit_buffers (void)
 Conversion routine. More...


Protected Attributes

ACE_Message_Blockheader_
 Header data. More...

size_t header_bytes_
 Size of header data. More...

ACE_Message_Blocktrailer_
 Trailer data. More...

size_t trailer_bytes_
 Size of trailer data. More...

ACE_TRANSMIT_FILE_BUFFERS transmit_buffers_
 Target data structure. More...


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 1129 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 970 of file Asynch_IO.cpp.

00974   : header_ (header),
00975     header_bytes_ (header_bytes),
00976     trailer_ (trailer),
00977     trailer_bytes_ (trailer_bytes)
00978 {
00979 }

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

Destructor.

Definition at line 981 of file Asynch_IO.cpp.

00982 {
00983 }


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 1004 of file Asynch_IO.cpp.

References header_.

01005 {
01006   this->header_ = message_block;
01007 }

ACE_Message_Block * ACE_Asynch_Transmit_File::Header_And_Trailer::header void    const
 

Get header which goes before the file data.

Definition at line 998 of file Asynch_IO.cpp.

References header_.

Referenced by header_and_trailer.

00999 {
01000   return this->header_;
01001 }

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 986 of file Asynch_IO.cpp.

References header, header_bytes, trailer, and trailer_bytes.

00990 {
00991   this->header (header);
00992   this->header_bytes (header_bytes);
00993   this->trailer (trailer);
00994   this->trailer_bytes (trailer_bytes);
00995 }

void ACE_Asynch_Transmit_File::Header_And_Trailer::header_bytes size_t    bytes
 

Set size of the header data.

Definition at line 1016 of file Asynch_IO.cpp.

References header_bytes_.

01017 {
01018   this->header_bytes_ = bytes;
01019 }

size_t ACE_Asynch_Transmit_File::Header_And_Trailer::header_bytes void    const
 

Get size of the header data.

Definition at line 1010 of file Asynch_IO.cpp.

References header_bytes_.

Referenced by header_and_trailer, and ACE_POSIX_Asynch_Transmit_Handler::transmit.

01011 {
01012   return this->header_bytes_;
01013 }

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 1028 of file Asynch_IO.cpp.

References trailer_.

01029 {
01030   this->trailer_ = message_block;
01031 }

ACE_Message_Block * ACE_Asynch_Transmit_File::Header_And_Trailer::trailer void    const
 

Get trailer which goes after the file data.

Definition at line 1022 of file Asynch_IO.cpp.

References trailer_.

Referenced by header_and_trailer.

01023 {
01024   return this->trailer_;
01025 }

void ACE_Asynch_Transmit_File::Header_And_Trailer::trailer_bytes size_t    bytes
 

Set size of the trailer data.

Definition at line 1040 of file Asynch_IO.cpp.

References trailer_bytes_.

01041 {
01042   this->trailer_bytes_ = bytes;
01043 }

size_t ACE_Asynch_Transmit_File::Header_And_Trailer::trailer_bytes void    const
 

Get size of the trailer data.

Definition at line 1034 of file Asynch_IO.cpp.

References trailer_bytes_.

Referenced by header_and_trailer, and ACE_POSIX_Asynch_Transmit_Handler::initiate_read_file.

01035 {
01036   return this->trailer_bytes_;
01037 }

ACE_LPTRANSMIT_FILE_BUFFERS ACE_Asynch_Transmit_File::Header_And_Trailer::transmit_buffers void   
 

Conversion routine.

Definition at line 1046 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.

01047 {
01048   // If both are zero, return zero
01049   if (this->header_ == 0 && this->trailer_ == 0)
01050     return 0;
01051   else
01052     {
01053       // Something is valid
01054 
01055       // If header is valid, set the fields
01056       if (this->header_ != 0)
01057         {
01058           this->transmit_buffers_.Head = this->header_->rd_ptr ();
01059 #if defined(ACE_WIN64)
01060           this->transmit_buffers_.HeadLength =
01061             ACE_static_cast (DWORD, this->header_bytes_);
01062 #else
01063           this->transmit_buffers_.HeadLength = this->header_bytes_;
01064 #endif /* ACE_WIN64 */
01065         }
01066       else
01067         {
01068           this->transmit_buffers_.Head = 0;
01069           this->transmit_buffers_.HeadLength = 0;
01070         }
01071 
01072       // If trailer is valid, set the fields
01073       if (this->trailer_ != 0)
01074         {
01075           this->transmit_buffers_.Tail = this->trailer_->rd_ptr ();
01076 #if defined(ACE_WIN64)
01077           this->transmit_buffers_.TailLength =
01078             ACE_static_cast (DWORD, this->trailer_bytes_);
01079 #else
01080           this->transmit_buffers_.TailLength = this->trailer_bytes_;
01081 #endif /* ACE_WIN64 */
01082         }
01083       else
01084         {
01085           this->transmit_buffers_.Tail = 0;
01086           this->transmit_buffers_.TailLength = 0;
01087         }
01088 
01089       // Return the transmit buffers
01090       return &this->transmit_buffers_;
01091     }
01092 }


Member Data Documentation

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

Header data.

Definition at line 1177 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 1180 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 1183 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 1186 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 1189 of file Asynch_IO.h.

Referenced by transmit_buffers.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:45:35 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002