Principal.cpp

Go to the documentation of this file.
00001 // Principal.cpp,v 1.19 2006/03/10 07:19:06 jtc Exp
00002 
00003 // Copyright 1994-1995 by Sun Microsystems Inc.
00004 // All Rights Reserved
00005 // ORB:         Principal identifier pseudo-objref
00006 
00007 #include "tao/Principal.h"
00008 #include "tao/CDR.h"
00009 
00010 #if !defined (__ACE_INLINE__)
00011 #include "tao/Principal.i"
00012 #endif /* __ACE_INLINE__ */
00013 
00014 ACE_RCSID (tao,
00015            Principal,
00016            "Principal.cpp,v 1.19 2006/03/10 07:19:06 jtc Exp")
00017 
00018 
00019 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00020 
00021 CORBA::Principal::Principal (void)
00022   : refcount_ (1)
00023 {
00024 }
00025 
00026 CORBA::Principal::~Principal (void)
00027 {
00028 }
00029 
00030 CORBA::Boolean
00031 operator<< (TAO_OutputCDR & cdr, CORBA::Principal * x)
00032 {
00033   if (x != 0)
00034     {
00035       CORBA::ULong length  = x->id.length ();
00036       cdr.write_long (length);
00037       cdr.write_octet_array (x->id.get_buffer (), length);
00038     }
00039   else
00040     {
00041       cdr.write_ulong (0);
00042     }
00043 
00044   return (CORBA::Boolean) cdr.good_bit ();
00045 }
00046 
00047 CORBA::Boolean
00048 operator>> (TAO_InputCDR & cdr, CORBA::Principal *& x)
00049 {
00050   CORBA::ULong length;
00051   cdr.read_ulong (length);
00052 
00053   if (length == 0 || !cdr.good_bit ())
00054     {
00055       x = 0;
00056     }
00057   else
00058     {
00059       ACE_NEW_RETURN (x, CORBA::Principal, 0);
00060       x->id.length (length);
00061       cdr.read_octet_array (x->id.get_buffer (), length);
00062     }
00063 
00064   return (CORBA::Boolean) cdr.good_bit ();
00065 }
00066 
00067 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 11:54:20 2006 for TAO by doxygen 1.3.6