summaryrefslogtreecommitdiff
path: root/TAO/tao/Principal.cpp
blob: 6e3748730a362404d5bf4e4a60a8b05d57da0137 (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
// $Id$

// Copyright 1994-1995 by Sun Microsystems Inc.
// All Rights Reserved
// ORB:		Principal identifier pseudo-objref

#include "tao/corba.h"

void
CORBA::release (CORBA::Principal_ptr principal)
{
  if (principal)
    principal->Release ();
}

CORBA::Boolean
CORBA::is_nil (CORBA::Principal_ptr principal)
{
  return (CORBA::Boolean) (principal == 0);
}

CORBA_Principal::CORBA_Principal (void)
{
}

CORBA_Principal::~CORBA_Principal (void)
{
  assert (refcount_ == 0);
}

CORBA::ULong
CORBA_Principal::AddRef (void)
{
  return ++refcount_;
}

CORBA::ULong
CORBA_Principal::Release (void)
{
  {
    if (--refcount_ != 0)
      return refcount_;
  }

  delete this;
  return 0;
}