3 //=============================================================================
5 * @file Messaging_Policy_i.h
7 * @author Carlos O'Ryan (coryan@cs.wustl.edu)
9 //=============================================================================
11 #ifndef TAO_MESSAGING_POLICY_I_H
12 #define TAO_MESSAGING_POLICY_I_H
13 #include /**/ "ace/pre.h"
15 #include "tao/orbconf.h"
16 #include "tao/Messaging/Messaging.h"
17 #include "tao/LocalObject.h"
21 #pragma warning(disable:4250)
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
26 #if (TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1)
29 * @class TAO_RelativeRoundtripTimeoutPolicy
31 * @brief Messaging::RelativeRoundtripTimeoutPolicy implementation
33 * This policy controls the total (round-trip) timeout time for a
36 class TAO_RelativeRoundtripTimeoutPolicy
37 : public Messaging::RelativeRoundtripTimeoutPolicy
,
38 public ::CORBA::LocalObject
42 TAO_RelativeRoundtripTimeoutPolicy (const TimeBase::TimeT
& relative_expiry
);
45 TAO_RelativeRoundtripTimeoutPolicy (const TAO_RelativeRoundtripTimeoutPolicy
&rhs
);
47 /// Implement the timeout hook, this is set in the ORB_Core at
48 /// initialization time.
49 static void hook (TAO_ORB_Core
*orb_core
,
52 ACE_Time_Value
&time_value
);
54 /// Helper method for the implementation of
55 /// CORBA::ORB::create_policy.
56 static CORBA::Policy_ptr
create (const CORBA::Any
& val
);
58 /// Returns a copy of @c this.
59 virtual TAO_RelativeRoundtripTimeoutPolicy
*clone () const;
61 // = The Messaging::RelativeRoundtripTimeoutPolicy methods
62 virtual TimeBase::TimeT
relative_expiry ();
64 virtual CORBA::PolicyType
policy_type ();
66 virtual CORBA::Policy_ptr
copy ();
68 virtual void destroy ();
70 /// Change the CORBA representation to the ACE representation.
71 void set_time_value (ACE_Time_Value
&time_value
);
73 /// Return the cached policy type for this policy.
74 virtual TAO_Cached_Policy_Type
_tao_cached_type () const;
78 TimeBase::TimeT relative_expiry_
;
81 #endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */
83 ////////////////////////////////////////////////////////////////////////////////
85 #if (TAO_HAS_SYNC_SCOPE_POLICY == 1)
88 * @class TAO_Sync_Scope_Policy
90 * @brief Messaging::SyncScopePolicy implementation.
92 * This policy controls the sync strategy used by the ORB to transport
95 class TAO_Messaging_Export TAO_Sync_Scope_Policy
96 : public Messaging::SyncScopePolicy
,
97 public ::CORBA::LocalObject
101 TAO_Sync_Scope_Policy (Messaging::SyncScope synchronization
);
103 /// Copy constructor.
104 TAO_Sync_Scope_Policy (const TAO_Sync_Scope_Policy
&rhs
);
106 /// Implement the Sync_Scope hook, this is set in the ORB_Core at
107 /// initialization time.
108 static void hook (TAO_ORB_Core
*orb_core
,
110 bool &has_synchronization
,
111 Messaging::SyncScope
&scope
);
113 /// Helper method for the implementation of
114 /// CORBA::ORB::create_policy.
115 static CORBA::Policy_ptr
create (const CORBA::Any
& val
);
117 /// Returns a copy of <this>.
118 virtual TAO_Sync_Scope_Policy
*clone () const;
120 // = The Messaging::SyncScopePolicy methods.
122 virtual Messaging::SyncScope
synchronization ();
124 void get_synchronization (Messaging::SyncScope
&synchronization
) const;
126 virtual CORBA::PolicyType
policy_type ();
128 virtual CORBA::Policy_ptr
copy ();
130 virtual void destroy ();
132 // Return the cached policy type for this policy.
133 virtual TAO_Cached_Policy_Type
_tao_cached_type () const;
136 Messaging::SyncScope synchronization_
;
139 #endif /* TAO_HAS_SYNC_SCOPE_POLICY == 1 */
141 TAO_END_VERSIONED_NAMESPACE_DECL
143 #if defined (__ACE_INLINE__)
144 #include "tao/Messaging/Messaging_Policy_i.inl"
145 #endif /* __ACE_INLINE__ */
147 #if defined(_MSC_VER)
149 #endif /* _MSC_VER */
151 #include /**/ "ace/post.h"
152 #endif /* TAO_MESSAGING_POLICY_I_H */