Transport_Queueing_Strategies.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Transport_Queueing_Strategies.h
00006  *
00007  *  $Id: Transport_Queueing_Strategies.h 79237 2007-08-07 09:48:21Z johnnyw $
00008  *
00009  *  Queueing strategies for the ORB Messaging layer.
00010  *
00011  *  @author  Irfan Pyarali
00012  */
00013 //=============================================================================
00014 
00015 
00016 #ifndef TAO_TRANSPORT_QUEUEING_STRATEGIES_H
00017 #define TAO_TRANSPORT_QUEUEING_STRATEGIES_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include /**/ "tao/TAO_Export.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "tao/orbconf.h"
00028 #include "tao/Basic_Types.h"
00029 
00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00031 class ACE_Time_Value;
00032 ACE_END_VERSIONED_NAMESPACE_DECL
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 class TAO_Stub;
00037 
00038 namespace TAO
00039 {
00040   /// Define the interface for the Queueing Strategy
00041   /**
00042    * The low-level I/O components in the ORB use this strategy to
00043    * determine when messages must be queued, immediately sent or
00044    * flushed.
00045    *
00046    * The strategy isolates this low-level components from the higher
00047    * level strategies used by the application developer.
00048    */
00049   class TAO_Export Transport_Queueing_Strategy
00050   {
00051   public:
00052     /// Destructor
00053     virtual ~Transport_Queueing_Strategy (void);
00054 
00055     /// Return true if a message must be queued
00056     virtual bool must_queue (bool queue_empty) const = 0;
00057 
00058     /// Return true if it is time to start
00059     /**
00060      * @param stub The object used to make the request, this is used to
00061      *        obtain the policies currently in effect for the request
00062      * @param msg_count The number of messages currently queued
00063      * @param total_bytes Number of bytes currently queued
00064      * @param set_timer Returns true if a timer should be set to drain the
00065      *        queue
00066      * @param interval If set_timer returns 1, this parameter contains
00067      *        the timer interval
00068      * @param must_flush Is set to true if things must be flushed at this
00069      *        moment
00070      */
00071     virtual bool buffering_constraints_reached (
00072       TAO_Stub *stub,
00073       size_t msg_count,
00074       size_t total_bytes,
00075       bool &must_flush,
00076       const ACE_Time_Value &current_deadline,
00077       bool &set_timer,
00078       ACE_Time_Value &interval) const = 0;
00079   };
00080 
00081   /**
00082    * This strategy doesn't not queue by default, but when a message is queued
00083    * we always flush it to the transport. This is used for oneways with
00084    * SYNC_WITH_TRANSPORT, SYNC_WITH_SERVER and SYNC_WITH_TARGET
00085    */
00086   class Flush_Transport_Queueing_Strategy : public Transport_Queueing_Strategy
00087   {
00088   public:
00089     virtual bool must_queue (bool queue_empty) const;
00090 
00091     virtual bool buffering_constraints_reached (
00092       TAO_Stub *stub,
00093       size_t msg_count,
00094       size_t total_bytes,
00095       bool &must_flush,
00096       const ACE_Time_Value &current_deadline,
00097       bool &set_timer,
00098       ACE_Time_Value &interval) const;
00099   };
00100 }
00101 
00102 TAO_END_VERSIONED_NAMESPACE_DECL
00103 
00104 #include /**/ "ace/post.h"
00105 
00106 #endif /* TAO_TRANSPORT_QUEUEING_STRATEGY_H */

Generated on Tue Feb 2 17:37:53 2010 for TAO by  doxygen 1.4.7