Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / Messaging / Messaging_Queueing_Strategies.h
blobbab3dbbe6e8482a5994a5c18ec5fcd1e01a88f19
1 // -*- C++ -*-
3 //=============================================================================
4 /**
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)
22 # 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
31 namespace TAO
33 struct BufferingConstraint;
36 namespace TimeBase
38 typedef CORBA::ULongLong TimeT;
41 namespace TAO
43 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
45 class Eager_Transport_Queueing_Strategy : public Transport_Queueing_Strategy
47 public:
48 bool must_queue (bool queue_empty) const override;
50 bool buffering_constraints_reached (
51 TAO_Stub *stub,
52 size_t msg_count,
53 size_t total_bytes,
54 bool &must_flush,
55 const ACE_Time_Value &current_deadline,
56 bool &set_timer,
57 ACE_Time_Value &new_deadline) const override;
59 private:
60 /// Check if the buffering constraint includes any timeouts and
61 /// compute the right timeout interval if needed.
62 /**
63 * @param buffering_constraint The constraints defined by the
64 * application
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
72 * set_timer and
74 bool timer_check (const TAO::BufferingConstraint &buffering_constraint,
75 const ACE_Time_Value &current_deadline,
76 bool &set_timer,
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
84 /**
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
90 public:
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 */