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

Asynch_Queued_Message.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file Asynch_Queued_Message.h
00006  *
00007  *  $Id: Asynch_Queued_Message.h,v 1.1.1.2 2003/02/21 18:36:44 chad Exp $
00008  *
00009  *  @author Carlos O'Ryan <coryan@uci.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_ASYNCH_QUEUED_MESSAGE_H
00014 #define TAO_ASYNCH_QUEUED_MESSAGE_H
00015 #include "ace/pre.h"
00016 
00017 #include "Queued_Message.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 /**
00024  * @class TAO_Asynch_Queued_Message
00025  *
00026  * @brief Specialize TAO_Queued_Message for asynch requests,
00027  *        i.e. oneways sent with SYNC_NONE policy.
00028  *
00029  */
00030 class TAO_Export TAO_Asynch_Queued_Message : public TAO_Queued_Message
00031 {
00032 public:
00033   /// Constructor
00034   /**
00035    * @param contents The message block chain that must be sent.
00036    *
00037    * @param alloc Allocator used for creating <this> object.
00038    *
00039    * @todo I'm almost sure this class will require a callback
00040    *       interface for AMIs sent with SYNC_NONE policy.  Those guys
00041    *       need to hear when the connection timeouts or closes, but
00042    *       cannot block waiting for the message to be delivered.
00043    */
00044   TAO_Asynch_Queued_Message (const ACE_Message_Block *contents,
00045                              ACE_Allocator *alloc = 0,
00046                              int is_heap_allocated = 0);
00047 
00048 
00049   /// Destructor
00050   virtual ~TAO_Asynch_Queued_Message (void);
00051 
00052   /** Implement the Template Methods from TAO_Queued_Message
00053    */
00054   //@{
00055   virtual size_t message_length (void) const;
00056   virtual int all_data_sent (void) const;
00057   virtual void fill_iov (int iovcnt_max, int &iovcnt, iovec iov[]) const;
00058   virtual void bytes_transferred (size_t &byte_count);
00059   /// @@NOTE: No reason to belive why this would be called. But have
00060   /// it here for the sake of uniformity.
00061   virtual TAO_Queued_Message *clone (ACE_Allocator *alloc);
00062   virtual void destroy (void);
00063   //@}
00064 
00065 protected:
00066   /// Constructor
00067   /**
00068    * @param buf The buffer that needs to be sent on the wire. The
00069    *            buffer will be owned by this class. The buffer will be
00070    *            deleted when the destructor is called and hence the
00071    *            buffer should always come off the heap!
00072    *
00073    * @param size The size of the buffer <buf> that is being handed
00074    *             over.
00075    *
00076    * @param alloc Allocator used for creating <this> object.
00077    */
00078   TAO_Asynch_Queued_Message (char *buf,
00079                              size_t size,
00080                              ACE_Allocator *alloc = 0);
00081 private:
00082   /// The number of bytes in the buffer
00083   size_t size_;
00084 
00085   /// The offset in the buffer
00086   /**
00087    * Data up to @c offset has been sent already, only the
00088    * [offset_,size_) range remains to be sent.
00089    */
00090   size_t offset_;
00091 
00092   /// The buffer containing the complete message.
00093   char *buffer_;
00094 };
00095 
00096 #include "ace/post.h"
00097 #endif  /* TAO_ASYNCH_QUEUED_MESSAGE_H */

Generated on Mon Jun 16 13:48:01 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002