Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Transport_Queueing_Strategies.h
blob45a8dda4a6cfd57e253574fc46f7d3e029b44b8f
1 // -*- C++ -*-
3 //=============================================================================
4 /**
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)
22 # 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
29 class ACE_Time_Value;
30 ACE_END_VERSIONED_NAMESPACE_DECL
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 class TAO_Stub;
36 namespace TAO
38 /// Define the interface for the Queueing Strategy
39 /**
40 * The low-level I/O components in the ORB use this strategy to
41 * determine when messages must be queued, immediately sent or
42 * flushed.
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
49 public:
50 /// Destructor
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
57 /**
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
63 * queue
64 * @param interval If set_timer returns 1, this parameter contains
65 * the timer interval
66 * @param must_flush Is set to true if things must be flushed at this
67 * moment
69 virtual bool buffering_constraints_reached (
70 TAO_Stub *stub,
71 size_t msg_count,
72 size_t total_bytes,
73 bool &must_flush,
74 const ACE_Time_Value &current_deadline,
75 bool &set_timer,
76 ACE_Time_Value &interval) const = 0;
79 /**
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
86 public:
87 virtual bool must_queue (bool queue_empty) const;
89 virtual bool buffering_constraints_reached (
90 TAO_Stub *stub,
91 size_t msg_count,
92 size_t total_bytes,
93 bool &must_flush,
94 const ACE_Time_Value &current_deadline,
95 bool &set_timer,
96 ACE_Time_Value &interval) const;
100 TAO_END_VERSIONED_NAMESPACE_DECL
102 #include /**/ "ace/post.h"
104 #endif /* TAO_TRANSPORT_QUEUEING_STRATEGY_H */