Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / RTPortableServer / RT_POA.inl
blob8326d0903a1811a70d78fa9f9c7fe65a4e025a6e
1 // -*- C++ -*-
2 // Exception macros
3 #include "tao/PortableServer/poa_macros.h"
4 #include "tao/PortableServer/POA_Guard.h"
6 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
8 ACE_INLINE CORBA::Object_ptr
9 TAO_RT_POA::create_reference_with_priority (const char * intf,
10                                             RTCORBA::Priority priority)
12   // Check that this method can be used based on this POA's policies.
13   this->validate_policies ();
15   this->validate_priority (priority);
17   // Lock access for the duration of this transaction.
18   TAO_POA_GUARD_RETURN (0);
20   return this->create_reference_i (intf, priority);
23 #if !defined (CORBA_E_MICRO)
24 ACE_INLINE CORBA::Object_ptr
25 TAO_RT_POA::create_reference_with_id_and_priority (const PortableServer::ObjectId & oid,
26                                                    const char * intf,
27                                                    RTCORBA::Priority priority)
29   // Check that this method can be used based on this POA's policies.
30   this->validate_policies ();
32   this->validate_priority (priority);
34   // Lock access for the duration of this transaction.
35   TAO_POA_GUARD_RETURN (0);
37   return this->create_reference_with_id_i (oid, intf, priority);
39 #endif
41 ACE_INLINE PortableServer::ObjectId *
42 TAO_RT_POA::activate_object_with_priority (PortableServer::Servant servant,
43                                            RTCORBA::Priority priority)
45   // Check that this method can be used based on this POA's policies.
46   this->validate_policies ();
48   this->validate_priority (priority);
50   while (true)
51     {
52       bool wait_occurred_restart_call = false;
54       // Lock access for the duration of this transaction.
55       TAO_POA_GUARD_RETURN (0);
57       PortableServer::ObjectId *result =
58         this->activate_object_i (servant, priority, wait_occurred_restart_call);
60       // If we ended up waiting on a condition variable, the POA state
61       // may have changed while we are waiting.  Therefore, we need to
62       // restart this call.
63       if (wait_occurred_restart_call)
64         continue;
65       else
66         return result;
67     }
70 #if !defined (CORBA_E_MICRO)
71 ACE_INLINE void
72 TAO_RT_POA::activate_object_with_id_and_priority (const PortableServer::ObjectId & oid,
73                                                   PortableServer::Servant servant,
74                                                   RTCORBA::Priority priority)
76   // Check that this method can be used based on this POA's policies.
77   this->validate_policies ();
79   this->validate_priority (priority);
81   while (true)
82     {
83       bool wait_occurred_restart_call = false;
85       // Lock access for the duration of this transaction.
86       TAO_POA_GUARD;
88       this->activate_object_with_id_i (oid,
89                                        servant,
90                                        priority,
91                                        wait_occurred_restart_call);
93       // If we ended up waiting on a condition variable, the POA state
94       // may have changed while we are waiting.  Therefore, we need to
95       // restart this call.
96       if (wait_occurred_restart_call)
97         continue;
98       else
99         return;
100     }
102 #endif
104 ACE_INLINE void *
105 TAO_RT_POA::thread_pool () const
107   return this->thread_pool_;
110 TAO_END_VERSIONED_NAMESPACE_DECL