summaryrefslogtreecommitdiff
path: root/TAO/tao/Policy_Factory.i
blob: dcb8d6df032fc33bb6468a77658f1130bf110e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// $Id$

#if (TAO_HAS_RT_CORBA == 1)

// @@ Angelo: we rarely include files in the .i file, and generally
// try to avoid that.
# include "tao/RT_Policy_i.h"
# include "tao/RTCORBAC.h"

#endif /* (TAO_HAS_RT_CORBA == 1) */

// @@ Angelo: it looks like this function is going to grow over time,
// should go into the .cpp file.
ACE_INLINE CORBA::Policy *
TAO_Policy_Factory::create_policy (CORBA::PolicyType ptype)
{
  CORBA::Policy_ptr policy = 0;

#if (TAO_HAS_RT_CORBA == 1)

  if (ptype == RTCORBA::PRIORITY_MODEL_POLICY_TYPE)
    ACE_NEW_RETURN (policy, TAO_PriorityModelPolicy, 0);

  if (ptype == RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE)
    ACE_NEW_RETURN (policy, TAO_PriorityBandedConnectionPolicy, 0);

  if (ptype == RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE)
    ACE_NEW_RETURN (policy, TAO_ClientProtocolPolicy, 0);

#else
  ACE_UNUSED_ARG (ptype);

#endif /* (TAO_HAS_RT_CORBA == 1) */

  return policy;
}