Merge pull request #2220 from DOCGroup/revert-2217-jwi-inetwraning
[ACE_TAO.git] / TAO / tao / Messaging / Messaging_Policy_i.h
blob4c963aa57ed01fe42c50e93a89c979a90aa9e686
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Messaging_Policy_i.h
7 * @author Carlos O'Ryan (coryan@cs.wustl.edu)
8 */
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"
19 #if defined(_MSC_VER)
20 #pragma warning(push)
21 #pragma warning(disable:4250)
22 #endif /* _MSC_VER */
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
34 * request.
36 class TAO_RelativeRoundtripTimeoutPolicy
37 : public Messaging::RelativeRoundtripTimeoutPolicy,
38 public ::CORBA::LocalObject
40 public:
41 /// Constructor.
42 TAO_RelativeRoundtripTimeoutPolicy (const TimeBase::TimeT& relative_expiry);
44 /// Copy constructor.
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,
50 TAO_Stub *stub,
51 bool &has_timeout,
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;
76 private:
77 /// The attribute
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
93 * requests.
95 class TAO_Messaging_Export TAO_Sync_Scope_Policy
96 : public Messaging::SyncScopePolicy,
97 public ::CORBA::LocalObject
99 public:
100 /// Constructor.
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,
109 TAO_Stub *stub,
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;
134 private:
135 /// The attribute
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)
148 #pragma warning(pop)
149 #endif /* _MSC_VER */
151 #include /**/ "ace/post.h"
152 #endif /* TAO_MESSAGING_POLICY_I_H */