Merge pull request #2220 from DOCGroup/revert-2217-jwi-inetwraning
[ACE_TAO.git] / TAO / tao / Messaging / Connection_Timeout_Policy_i.h
blob53ef3556a4a812b96ed2a53bae41298d348fc7c4
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Connection_Timeout_Policy_i.h
7 * @author Balachandran Natarajan (bala@cs.wustl.edu)
8 */
9 //=============================================================================
11 #ifndef TAO_CONNECTION_TIMEOUT_POLICY_I_H
12 #define TAO_CONNECTION_TIMEOUT_POLICY_I_H
14 #include /**/ "ace/pre.h"
16 #include "tao/orbconf.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Messaging/TAO_ExtC.h"
23 #include "tao/LocalObject.h"
25 #if defined(_MSC_VER)
26 #pragma warning(push)
27 #pragma warning(disable:4250)
28 #endif /* _MSC_VER */
31 #if (TAO_HAS_CONNECTION_TIMEOUT_POLICY == 1)
33 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
36 * @class TAO_ConnectionTimeoutPolicy
38 * @brief TAO::ConnectionTimeoutPolicy implementation
40 * This policy controls the connection timeout time while
41 * establishing connections. This policy is proprietary to TAO.
43 class TAO_ConnectionTimeoutPolicy
44 : public TAO::ConnectionTimeoutPolicy,
45 public ::CORBA::LocalObject
47 public:
48 /// Constructor.
49 TAO_ConnectionTimeoutPolicy (const TimeBase::TimeT& relative_expiry);
51 /// Copy constructor.
52 TAO_ConnectionTimeoutPolicy (const TAO_ConnectionTimeoutPolicy &rhs);
54 /// Implement the timeout hook, this is set in the ORB_Core at
55 /// initialization time.
56 static void hook (TAO_ORB_Core *orb_core,
57 TAO_Stub *stub,
58 bool &has_timeout,
59 ACE_Time_Value &time_value);
61 /// Helper method for the implementation of
62 /// CORBA::ORB::create_policy.
63 static CORBA::Policy_ptr create (const CORBA::Any& val);
65 /// Returns a copy of <this>.
66 virtual TAO_ConnectionTimeoutPolicy *clone () const;
68 // = The TAO::ConnectionTinoutPolicy methods
69 virtual TimeBase::TimeT relative_expiry ();
71 virtual CORBA::PolicyType policy_type ();
73 virtual CORBA::Policy_ptr copy ();
75 virtual void destroy ();
77 /// Change the CORBA representation to the ACE representation.
78 void set_time_value (ACE_Time_Value &time_value);
80 /// Return the cached policy type for this policy.
81 virtual TAO_Cached_Policy_Type _tao_cached_type () const;
83 private:
84 /// The attribute
85 TimeBase::TimeT relative_expiry_;
88 TAO_END_VERSIONED_NAMESPACE_DECL
90 #endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */
92 #if defined(_MSC_VER)
93 #pragma warning(pop)
94 #endif /* _MSC_VER */
96 #include /**/ "ace/post.h"
98 #endif /* TAO_CONNECTION_TIMEOUT_POLICY_I_H */