00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
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
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 struct BufferingConstraint;
00041 }
00042
00043 namespace TimeBase
00044 {
00045 typedef CORBA::ULongLong TimeT;
00046 }
00047
00048 namespace TAO
00049 {
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 class Transport_Queueing_Strategy
00060 {
00061 public:
00062
00063 virtual ~Transport_Queueing_Strategy (void);
00064
00065
00066 virtual bool must_queue (bool queue_empty) const = 0;
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 virtual bool buffering_constraints_reached (
00082 TAO_Stub *stub,
00083 size_t msg_count,
00084 size_t total_bytes,
00085 bool &must_flush,
00086 const ACE_Time_Value ¤t_deadline,
00087 bool &set_timer,
00088 ACE_Time_Value &interval) const = 0;
00089 };
00090
00091 class Default_Transport_Queueing_Strategy : public Transport_Queueing_Strategy
00092 {
00093 public:
00094 virtual bool must_queue (bool queue_empty) const;
00095
00096 virtual bool buffering_constraints_reached (
00097 TAO_Stub *stub,
00098 size_t msg_count,
00099 size_t total_bytes,
00100 bool &must_flush,
00101 const ACE_Time_Value ¤t_deadline,
00102 bool &set_timer,
00103 ACE_Time_Value &interval) const;
00104 };
00105
00106
00107
00108
00109
00110
00111 class Flush_Transport_Queueing_Strategy : public Transport_Queueing_Strategy
00112 {
00113 public:
00114 virtual bool must_queue (bool queue_empty) const;
00115
00116 virtual bool buffering_constraints_reached (
00117 TAO_Stub *stub,
00118 size_t msg_count,
00119 size_t total_bytes,
00120 bool &must_flush,
00121 const ACE_Time_Value ¤t_deadline,
00122 bool &set_timer,
00123 ACE_Time_Value &interval) const;
00124 };
00125
00126 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
00127
00128 class Eager_Transport_Queueing_Strategy : public Transport_Queueing_Strategy
00129 {
00130 public:
00131 virtual bool must_queue (bool queue_empty) const;
00132
00133 virtual bool buffering_constraints_reached (
00134 TAO_Stub *stub,
00135 size_t msg_count,
00136 size_t total_bytes,
00137 bool &must_flush,
00138 const ACE_Time_Value ¤t_deadline,
00139 bool &set_timer,
00140 ACE_Time_Value &new_deadline) const;
00141
00142 private:
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157 bool timer_check (const TAO::BufferingConstraint &buffering_constraint,
00158 const ACE_Time_Value ¤t_deadline,
00159 bool &set_timer,
00160 ACE_Time_Value &new_deadline) const;
00161
00162
00163 ACE_Time_Value time_conversion (const TimeBase::TimeT &time) const;
00164 };
00165
00166
00167
00168
00169
00170 class Delayed_Transport_Queueing_Strategy
00171 : public Eager_Transport_Queueing_Strategy
00172 {
00173 public:
00174 virtual bool must_queue (bool queue_empty) const;
00175 };
00176
00177 #endif
00178
00179 }
00180
00181 TAO_END_VERSIONED_NAMESPACE_DECL
00182
00183 #include "ace/post.h"
00184
00185 #endif