Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / RTCORBA / RT_Stub.h
blobe0b4ee0014059812c1ba0795db3c6437ecc7297b
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file RT_Stub.h
7 * This file contains the declaration for the RTCORBA Stub.
9 * @author Angelo Corsaro <corsaro@cs.wustl.edu>
10 * @author Frank Hunleth <fhunleth@cs.wustl.edu>
12 //=============================================================================
14 #ifndef TAO_RT_STUB_H_
15 #define TAO_RT_STUB_H_
17 #include /**/ "ace/pre.h"
19 #include "tao/orbconf.h"
21 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
23 #include "tao/RTCORBA/rtcorba_export.h"
25 #include "tao/Stub.h"
27 #if !defined (ACE_LACKS_PRAGMA_ONCE)
28 # pragma once
29 #endif /* ACE_LACKS_PRAGMA_ONCE */
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 // Forward references.
34 class TAO_PriorityModelPolicy;
35 class TAO_PriorityBandedConnectionPolicy;
36 class TAO_ClientProtocolPolicy;
37 class TAO_PrivateConnectionPolicy;
39 /**
40 * @class TAO_RT_Stub
42 * This class represent a stub with extended functionality, which are needed
43 * for RTCORBA.
45 class TAO_RTCORBA_Export TAO_RT_Stub : public TAO_Stub
47 public:
48 TAO_RT_Stub (const char *repository_id,
49 const TAO_MProfile &profiles,
50 TAO_ORB_Core *orb_core);
52 virtual ~TAO_RT_Stub ();
55 #if (TAO_HAS_CORBA_MESSAGING == 1)
57 /**
58 * Returns the effective policy if @a type is a known client-exposed
59 * policy type. Returns the effective override for all other policy
60 * types.
62 CORBA::Policy_ptr get_policy (CORBA::PolicyType type);
64 CORBA::Policy_ptr get_cached_policy (TAO_Cached_Policy_Type type);
66 TAO_Stub* set_policy_overrides (const CORBA::PolicyList & policies,
67 CORBA::SetOverrideType set_add);
69 #endif /* TAO_HAS_CORBA_MESSAGING */
71 private:
72 /// Helper method used to parse the policies.
73 void parse_policies ();
75 void exposed_priority_model (CORBA::Policy_ptr policy);
77 void exposed_priority_banded_connection (CORBA::Policy_ptr policy);
79 void exposed_client_protocol (CORBA::Policy_ptr policy);
81 /// Returns the CORBA::Policy (which will be narrowed to be
82 /// used as RTCORBA::PriorityModelPolicy) exported
83 /// in object's IOR.
84 CORBA::Policy_ptr exposed_priority_model ();
86 /// Returns the CORBA::Policy (which will be narrowed and used
87 /// as RTCORBA::PriorityBandedConnectionPolicy) exported
88 /// in object's IOR.
89 CORBA::Policy_ptr exposed_priority_banded_connection ();
91 /// Returns the CORBA::Policy (which will be narrowed and used
92 /// as RTCORBA::ClientProtocolPolicy) exported
93 /// in object's IOR.
94 CORBA::Policy_ptr exposed_client_protocol ();
96 // = Methods for obtaining effective policies.
98 // Effective policy is the one that would be used if a request
99 // were made. The policy is determined by obtaining the effective
100 // override for a given policy type, and then reconciling it with
101 // the policy value exported in the Object's IOR.
103 CORBA::Policy_ptr effective_priority_banded_connection ();
104 CORBA::Policy_ptr effective_client_protocol ();
106 // The following attribute are used to cache
107 // the different kind of policies and avoid to
108 // parse the MProfile's policy list each time we
109 // are asked about a given policy.
111 CORBA::Policy_var priority_model_policy_;
113 CORBA::Policy_var priority_banded_connection_policy_;
115 CORBA::Policy_var client_protocol_policy_;
117 bool are_policies_parsed_;
119 private:
120 // = Disallow copying and assignment.
121 TAO_RT_Stub (const TAO_RT_Stub &);
122 TAO_RT_Stub &operator = (const TAO_RT_Stub &);
125 TAO_END_VERSIONED_NAMESPACE_DECL
127 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
129 #include /**/ "ace/post.h"
131 #endif /* TAO_RT_STUB_FACTORY_H_ */