Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tao / PortableServer / POA_Cached_Policies.h
blob3465c355dc487843771875e38e38682503893505
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file POA_Cached_Policies.h
7 * POA
9 * @author Irfan Pyarali
11 //=============================================================================
13 #ifndef TAO_POA_CACHED_POLICIES_H
14 #define TAO_POA_CACHED_POLICIES_H
15 #include /**/ "ace/pre.h"
17 #include "tao/PortableServer/portableserver_export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/PortableServer/ThreadPolicyC.h"
24 #include "tao/PortableServer/LifespanPolicyC.h"
25 #include "tao/PortableServer/IdUniquenessPolicyC.h"
26 #include "tao/PortableServer/IdAssignmentPolicyC.h"
27 #include "tao/PortableServer/ImplicitActivationPolicyC.h"
28 #include "tao/PortableServer/ServantRetentionPolicyC.h"
29 #include "tao/PortableServer/RequestProcessingPolicyC.h"
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 // Forward references.
34 class TAO_POA_Policy_Set;
36 namespace TAO
38 namespace Portable_Server
40 class TAO_PortableServer_Export Cached_Policies
42 public:
43 enum PriorityModel
45 CLIENT_PROPAGATED,
46 SERVER_DECLARED,
47 NOT_SPECIFIED
50 enum NetworkPriorityModel
52 CLIENT_PROPAGATED_NETWORK_PRIORITY,
53 SERVER_DECLARED_NETWORK_PRIORITY,
54 NO_NETWORK_PRIORITY
57 Cached_Policies ();
59 ~Cached_Policies ();
61 /// Update the cached policy values.
62 void update (TAO_POA_Policy_Set &policy_set);
64 /**
65 * @name Accessor methods to cached values.
67 //@{
68 ::PortableServer::ThreadPolicyValue thread () const;
69 ::PortableServer::LifespanPolicyValue lifespan () const;
70 ::PortableServer::IdUniquenessPolicyValue id_uniqueness () const;
71 ::PortableServer::IdAssignmentPolicyValue id_assignment () const;
72 ::PortableServer::ImplicitActivationPolicyValue implicit_activation () const;
73 ::PortableServer::ServantRetentionPolicyValue servant_retention () const;
74 ::PortableServer::RequestProcessingPolicyValue request_processing () const;
75 PriorityModel priority_model () const;
76 CORBA::Short server_priority () const;
78 /// Returns the network priority model that was set using a policy
79 /// by the server application.
80 ///
81 NetworkPriorityModel network_priority_model () const;
83 /// Returns the request DiffServ codepoint that was set using a policy
84 /// by the server application.
85 ///
86 CORBA::Long request_diffserv_codepoint () const;
88 /// Returns the reply DiffServ codepoint that was set using a policy
89 /// by the server application.
90 ///
91 CORBA::Long reply_diffserv_codepoint () const;
93 /// Caches the network priority model that was set using a policy
94 /// by the server application.
95 ///
96 void network_priority_model (
97 NetworkPriorityModel network_priority_model);
99 /// Caches the request DiffServ codepoint that was set using a policy
100 /// by the server application.
102 void request_diffserv_codepoint (CORBA::Long diffserv_codepoint);
104 /// Caches the reply DiffServ codepoint that was set using a policy
105 /// by the server application.
107 void reply_diffserv_codepoint (CORBA::Long diffserv_codepoint);
109 void priority_model (PriorityModel priority_model);
110 void server_priority (CORBA::Short priority);
111 void implicit_activation (::PortableServer::ImplicitActivationPolicyValue value);
112 //@}
114 protected:
115 /// Helper method to update a particular policy.
116 void update_policy (const CORBA::Policy_ptr policy);
118 ::PortableServer::ThreadPolicyValue thread_;
120 ::PortableServer::LifespanPolicyValue lifespan_;
122 ::PortableServer::IdUniquenessPolicyValue id_uniqueness_;
124 ::PortableServer::IdAssignmentPolicyValue id_assignment_;
126 ::PortableServer::ImplicitActivationPolicyValue implicit_activation_;
128 ::PortableServer::ServantRetentionPolicyValue servant_retention_;
130 ::PortableServer::RequestProcessingPolicyValue request_processing_;
132 PriorityModel priority_model_;
134 CORBA::Short server_priority_;
136 NetworkPriorityModel network_priority_model_;
138 CORBA::Long request_diffserv_codepoint_;
140 CORBA::Long reply_diffserv_codepoint_;
145 TAO_END_VERSIONED_NAMESPACE_DECL
147 #if defined (__ACE_INLINE__)
148 # include "tao/PortableServer/POA_Cached_Policies.inl"
149 #endif /* __ACE_INLINE__ */
151 #include /**/ "ace/post.h"
152 #endif /* TAO_POA_CACHED_POLICIES_H */