1 // Copyright 1994-1995 by Sun Microsystems Inc.
3 // ORB: Principal identifier pseudo-objref
5 #include "tao/Principal.h"
8 #if !defined (__ACE_INLINE__)
9 #include "tao/Principal.inl"
10 #endif /* __ACE_INLINE__ */
12 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
14 CORBA::Principal::Principal ()
19 CORBA::Principal::~Principal ()
24 operator<< (TAO_OutputCDR
& cdr
, CORBA::Principal
* x
)
28 CORBA::ULong length
= x
->id
.length ();
29 cdr
.write_long (length
);
30 cdr
.write_octet_array (x
->id
.get_buffer (), length
);
37 return cdr
.good_bit ();
41 operator>> (TAO_InputCDR
& cdr
, CORBA::Principal
*& x
)
44 cdr
.read_ulong (length
);
46 if (length
== 0 || !cdr
.good_bit ())
52 ACE_NEW_RETURN (x
, CORBA::Principal
, 0);
53 x
->id
.length (length
);
54 cdr
.read_octet_array (x
->id
.get_buffer (), length
);
57 return cdr
.good_bit ();
60 TAO_END_VERSIONED_NAMESPACE_DECL