summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/Regular_POA.cpp
blob: 07a1f569f4b237a3a6860d89d4dd146b9d29fc84 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "tao/PortableServer/Regular_POA.h"

ACE_RCSID (PortableServer,
           POA,
           "$Id$")

//
#if !defined (__ACE_INLINE__)
# include "tao/PortableServer/Regular_POA.inl"
#endif /* ! __ACE_INLINE__ */

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO_Regular_POA::TAO_Regular_POA (const TAO_Root_POA::String &name,
                                  PortableServer::POAManager_ptr poa_manager,
                  const TAO_POA_Policy_Set &policies,
                  TAO_Root_POA *parent,
                  ACE_Lock &lock,
                  TAO_SYNCH_MUTEX &thread_lock,
                  TAO_ORB_Core &orb_core,
                  TAO_Object_Adapter *object_adapter
                  )
  : TAO_Root_POA (name,
                  poa_manager,
                  policies,
                  parent,
                  lock,
                  thread_lock,
                  orb_core,
                  object_adapter
                 ),
     parent_ (parent)
{
}

TAO_Regular_POA::~TAO_Regular_POA (void)
{
}

void
TAO_Regular_POA::remove_from_parent_i (void)
{
  // Remove POA from the parent
  if (this->parent_ != 0)
    {
      int result = this->parent_->delete_child (this->name_);
      if (result != 0)
        {
          throw ( ::CORBA::OBJ_ADAPTER ());
        }
    }
}

CORBA::Boolean
TAO_Regular_POA::root (void) const
{
  return (parent_ == 0);
}

char
TAO_Regular_POA::root_key_type (void)
{
  if (this->parent_ != 0)
    {
      return TAO_Root_POA::non_root_key_char ();
    }
  else
    {
      return TAO_Root_POA::root_key_type ();
    }
}

TAO_END_VERSIONED_NAMESPACE_DECL