3 //=============================================================================
5 * @file Messaging_Queueing_Strategies.h
7 * Queueing strategies for the ORB Messaging layer.
9 * @author Irfan Pyarali
11 //=============================================================================
14 #ifndef TAO_MESSAGING_QUEUEING_STRATEGIES_H
15 #define TAO_MESSAGING_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"
27 #include "tao/Transport_Queueing_Strategies.h"
29 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 struct BufferingConstraint
;
38 typedef CORBA::ULongLong TimeT
;
43 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
45 class Eager_Transport_Queueing_Strategy
: public Transport_Queueing_Strategy
48 bool must_queue (bool queue_empty
) const override
;
50 bool buffering_constraints_reached (
55 const ACE_Time_Value
¤t_deadline
,
57 ACE_Time_Value
&new_deadline
) const override
;
60 /// Check if the buffering constraint includes any timeouts and
61 /// compute the right timeout interval if needed.
63 * @param buffering_constraint The constraints defined by the
65 * @param current_deadline The current deadline
66 * @param set_timer Return true if the timer should be set
67 * @param new_deadline Return the timer interval value
69 * @return Returns true if the deadline has already expired and
70 * flushing must commence immediately. If the function
71 * returns false then flushing may need to be delayed, use @c
74 bool timer_check (const TAO::BufferingConstraint
&buffering_constraint
,
75 const ACE_Time_Value
¤t_deadline
,
77 ACE_Time_Value
&new_deadline
) const;
79 /// Convert from standard CORBA time units to seconds/microseconds.
80 ACE_Time_Value
time_conversion (const TimeBase::TimeT
&time
) const;
83 /// Delay the buffering decision until the transport blocks
85 * If the queue is empty the transport will try to send immediately.
87 class Delayed_Transport_Queueing_Strategy
88 : public Eager_Transport_Queueing_Strategy
91 bool must_queue (bool queue_empty
) const override
;
94 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
98 TAO_END_VERSIONED_NAMESPACE_DECL
100 #include /**/ "ace/post.h"
102 #endif /* TAO_MESSAGING_QUEUEING_STRATEGIES_H */