diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-12 16:18:58 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-12 16:18:58 +0000 |
commit | 414715263a41b8525f0371e9851cfc470171b0d5 (patch) | |
tree | bf1c5cdcd20e3d61ed9d590adfaef8b5fce061df /TAO/tao/Object_KeyC.cpp | |
parent | d918dcf7a60a0a69c33de11f3b8259b2065d2e38 (diff) | |
download | ATCD-414715263a41b8525f0371e9851cfc470171b0d5.tar.gz |
ChangeLogTag: Wed Mar 12 09:49:00 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/tao/Object_KeyC.cpp')
-rw-r--r-- | TAO/tao/Object_KeyC.cpp | 190 |
1 files changed, 156 insertions, 34 deletions
diff --git a/TAO/tao/Object_KeyC.cpp b/TAO/tao/Object_KeyC.cpp index 8d52f69c249..4e68b872b3c 100644 --- a/TAO/tao/Object_KeyC.cpp +++ b/TAO/tao/Object_KeyC.cpp @@ -1,56 +1,177 @@ +// -*- C++ -*- +// // $Id$ -// ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* -// TAO ORB and the TAO IDL Compiler have been developed by Washington -// University Computer Science's Distributed Object Computing Group. +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ // -// Information on TAO is available at -// http://www.cs.wustl.edu/~schmidt/TAO.html +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// W:\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:314 -#include "tao/Object_KeyC.h" + +#include "Object_KeyC.h" #include "tao/Typecode.h" +#include "tao/CDR.h" +#include "tao/ORB_Core.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ #if !defined (__ACE_INLINE__) #include "Object_KeyC.i" -#endif // !defined INLINE +#endif /* !defined INLINE */ -ACE_RCSID(tao, Object_KeyC, "$Id$") +// TAO_IDL - Generated from +// W:\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:284 -const CORBA::Long _oc_TAO__tao_seq_Octet[] = +static const CORBA::Long _oc_TAO_ObjectKey[] = { TAO_ENCAP_BYTE_ORDER, // byte order + 22, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x54414f2f), + ACE_NTOHL (0x4f626a65), + ACE_NTOHL (0x63744b65), + ACE_NTOHL (0x793a312e), + ACE_NTOHL (0x30000000), // repository ID = IDL:TAO/ObjectKey:1.0 + 10, + ACE_NTOHL (0x4f626a65), + ACE_NTOHL (0x63744b65), + ACE_NTOHL (0x79000000), // name = ObjectKey + CORBA::tk_sequence, // typecode kind + 12, // encapsulation length + TAO_ENCAP_BYTE_ORDER, // byte order CORBA::tk_octet, - 0, + 0U, + }; -CORBA::TypeCode _tc_TAO_tc_TAO__tao_seq_Octet (CORBA::tk_sequence, sizeof - (_oc_TAO__tao_seq_Octet), (char *) - &_oc_TAO__tao_seq_Octet, 0, - sizeof (TAO_ObjectKey)); -CORBA::TypeCode_ptr TAO_tc__tao_seq_Octet = &_tc_TAO_tc_TAO__tao_seq_Octet; -const CORBA::Long _oc_TAO_ObjectKey[] = +static CORBA::TypeCode _tc_TAO_tc_TAO_ObjectKey ( + CORBA::tk_alias, + sizeof (_oc_TAO_ObjectKey), + (char *) &_oc_TAO_ObjectKey, + 0, + sizeof (TAO::ObjectKey) + ); + +TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr) +TAO_NAMESPACE_BEGIN (TAO) +TAO_NAMESPACE_DEFINE ( + ::CORBA::TypeCode_ptr, + _tc_ObjectKey, + &_tc_TAO_tc_TAO_ObjectKey + ) +TAO_NAMESPACE_END + +// TAO_IDL - Generated from +// W:\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_sequence/cdr_op_cs.cpp:125 + +CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const TAO::ObjectKey &_tao_sequence + ) { - TAO_ENCAP_BYTE_ORDER, // byte order - 22, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x54414f2f), ACE_NTOHL (0x4f626a65), ACE_NTOHL (0x63744b65), ACE_NTOHL (0x793a312e), ACE_NTOHL (0x3000fdfd), // repository ID = IDL:TAO/ObjectKey:1.0 - 10, ACE_NTOHL (0x4f626a65), ACE_NTOHL (0x63744b65), ACE_NTOHL (0x7900fdfd), // name = ObjectKey - CORBA::tk_sequence, // typecode kind - 12, // encapsulation length - TAO_ENCAP_BYTE_ORDER, // byte order - CORBA::tk_octet, + CORBA::ULong _tao_seq_len = _tao_sequence.length (); + + if (strm << _tao_seq_len) + { + // Encode all elements. + +#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) + { + TAO_Unbounded_Sequence<CORBA::Octet> *oseq = + ACE_static_cast (TAO_Unbounded_Sequence<CORBA::Octet>*, (TAO::ObjectKey *)&_tao_sequence); + if (oseq->mb ()) + return strm.write_octet_array_mb (oseq->mb ()); + else + return strm.write_octet_array (_tao_sequence.get_buffer (), _tao_sequence.length ()); + } + +#else /* TAO_NO_COPY_OCTET_SEQUENCES == 0 */ + return strm.write_octet_array (_tao_sequence.get_buffer (), _tao_sequence.length ()); + +#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 0 */ + } + + return 0; +} - 0, -}; -CORBA::TypeCode _tc_TAO_tc_TAO_ObjectKey (CORBA::tk_alias, sizeof - (_oc_TAO_ObjectKey), (char *) - &_oc_TAO_ObjectKey, 0, - sizeof (TAO_ObjectKey)); -CORBA::TypeCode_ptr TAO_tc_ObjectKey = &_tc_TAO_tc_TAO_ObjectKey; +CORBA::Boolean operator>> ( + TAO_InputCDR &strm, + TAO::ObjectKey &_tao_sequence + ) +{ + CORBA::ULong _tao_seq_len; + + if (strm >> _tao_seq_len) + { + // Add a check to the length of the sequence + // to make sure it does not exceed the length + // of the stream. (See bug 58.) + if (_tao_seq_len > strm.length ()) + { + return 0; + } + + // Set the length of the sequence. + _tao_sequence.length (_tao_seq_len); + + // If length is 0 we return true. + if (0 >= _tao_seq_len) + { + return 1; + } + + // Retrieve all the elements. + +#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) + if (ACE_BIT_DISABLED (strm.start ()->flags (), + ACE_Message_Block::DONT_DELETE)) + { + TAO_ORB_Core* orb_core = strm.orb_core (); + if (orb_core != 0 && + strm.orb_core ()->resource_factory ()-> + input_cdr_allocator_type_locked () == 1) + { + TAO_Unbounded_Sequence<CORBA::Octet> *oseq = + ACE_static_cast(TAO_Unbounded_Sequence<CORBA::Octet>*, &_tao_sequence); + oseq->replace (_tao_seq_len, strm.start ()); + oseq->mb ()->wr_ptr (oseq->mb()->rd_ptr () + _tao_seq_len); + strm.skip_bytes (_tao_seq_len); + return 1; + } + } + return strm.read_octet_array (_tao_sequence.get_buffer (), _tao_seq_len); +#else /* TAO_NO_COPY_OCTET_SEQUENCES == 0 */ + return strm.read_octet_array (_tao_sequence.get_buffer (), _tao_sequence.length ()); + +#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 0 */ + } + + return 0; +} +// **************************************************************** void -TAO_ObjectKey::encode_sequence_to_string (char * &str, - const TAO_Unbounded_Sequence<CORBA::Octet> &seq) +TAO::ObjectKey::encode_sequence_to_string (char * &str, + const TAO_Unbounded_Sequence<CORBA::Octet> &seq) { // We must allocate a buffer which is (gag) 3 times the length // of the sequence, which is the length required in the worst-case @@ -89,8 +210,8 @@ TAO_ObjectKey::encode_sequence_to_string (char * &str, } void -TAO_ObjectKey::decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet> &seq, - const char *str) +TAO::ObjectKey::decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet> &seq, + const char *str) { if (str == 0) { @@ -131,3 +252,4 @@ TAO_ObjectKey::decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet> & } // **************************************************************** + |