3 //=============================================================================
5 * @file Transport_Queueing_Strategies.h
7 * Queueing strategies for the ORB Messaging layer.
9 * @author Irfan Pyarali
11 //=============================================================================
14 #ifndef TAO_TRANSPORT_QUEUEING_STRATEGIES_H
15 #define TAO_TRANSPORT_QUEUEING_STRATEGIES_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "tao/TAO_Export.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "tao/orbconf.h"
26 #include "tao/Basic_Types.h"
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
30 ACE_END_VERSIONED_NAMESPACE_DECL
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
38 /// Define the interface for the Queueing Strategy
40 * The low-level I/O components in the ORB use this strategy to
41 * determine when messages must be queued, immediately sent or
44 * The strategy isolates this low-level components from the higher
45 * level strategies used by the application developer.
47 class TAO_Export Transport_Queueing_Strategy
51 virtual ~Transport_Queueing_Strategy ();
53 /// Return true if a message must be queued
54 virtual bool must_queue (bool queue_empty
) const = 0;
56 /// Return true if it is time to start
58 * @param stub The object used to make the request, this is used to
59 * obtain the policies currently in effect for the request
60 * @param msg_count The number of messages currently queued
61 * @param total_bytes Number of bytes currently queued
62 * @param set_timer Returns true if a timer should be set to drain the
64 * @param interval If set_timer returns 1, this parameter contains
66 * @param must_flush Is set to true if things must be flushed at this
69 virtual bool buffering_constraints_reached (
74 const ACE_Time_Value
¤t_deadline
,
76 ACE_Time_Value
&interval
) const = 0;
80 * This strategy doesn't not queue by default, but when a message is queued
81 * we always flush it to the transport. This is used for oneways with
82 * SYNC_WITH_TRANSPORT, SYNC_WITH_SERVER and SYNC_WITH_TARGET
84 class Flush_Transport_Queueing_Strategy
: public Transport_Queueing_Strategy
87 virtual bool must_queue (bool queue_empty
) const;
89 virtual bool buffering_constraints_reached (
94 const ACE_Time_Value
¤t_deadline
,
96 ACE_Time_Value
&interval
) const;
100 TAO_END_VERSIONED_NAMESPACE_DECL
102 #include /**/ "ace/post.h"
104 #endif /* TAO_TRANSPORT_QUEUEING_STRATEGY_H */