// **********************************************************************
//
// Generated by the ORBacus IDL-to-C++ Translator
//
// Copyright (c) 1999
// Object Oriented Concepts, Inc.
// Billerica, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

// Version: 3.2
// License: non-commercial

#include <OB/CORBA.h>
#include <OB/TemplateI.h>
#include <OB/GIOP.h>

#ifndef OB_INTEGER_VERSION
#   error No ORBacus version defined!
#endif

#ifndef OB_NO_VERSION_CHECK
#   if (OB_INTEGER_VERSION != 3020000L)
#       error ORBacus version mismatch!
#   endif
#endif

//
// IDL:omg.org/GIOP/Version:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBFixVar< GIOP_Version >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBFixVar< GIOP_Version >)
#endif
#endif

void
OBMarshal(const GIOP_Version& val, CORBA_Octet*& oct)
{
    OBMarshal(val.major, oct);
    OBMarshal(val.minor, oct);
}

void
OBMarshalCount(const GIOP_Version& val, CORBA_ULong& count)
{
    OBMarshalCount(val.major, count);
    OBMarshalCount(val.minor, count);
}

void
OBUnmarshal(GIOP_Version& val, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshal(val.major, coct, swap);
    OBUnmarshal(val.minor, coct, swap);
}

//
// IDL:omg.org/GIOP/MessageHeader:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBFixVar< GIOP_MessageHeader >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBFixVar< GIOP_MessageHeader >)
#endif
#endif

void
OBMarshal(const GIOP_MessageHeader& val, CORBA_Octet*& oct)
{
    OBMarshal_OBUnsignedChar_4(val.magic, oct);
    OBMarshal(val.version, oct);
    OBMarshal(val.flag, oct);
    OBMarshal(val.message_type, oct);
    OBMarshal(val.message_size, oct);
}

void
OBMarshalCount(const GIOP_MessageHeader& val, CORBA_ULong& count)
{
    OBMarshalCount_OBUnsignedChar_4(val.magic, count);
    OBMarshalCount(val.version, count);
    OBMarshalCount(val.flag, count);
    OBMarshalCount(val.message_type, count);
    OBMarshalCount(val.message_size, count);
}

void
OBUnmarshal(GIOP_MessageHeader& val, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshal_OBUnsignedChar_4(val.magic, coct, swap);
    OBUnmarshal(val.version, coct, swap);
    OBUnmarshal(val.flag, coct, swap);
    OBUnmarshal(val.message_type, coct, swap);
    OBUnmarshal(val.message_size, coct, swap);
}

//
// IDL:omg.org/GIOP/RequestHeader:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBVarVar< GIOP_RequestHeader >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBVarVar< GIOP_RequestHeader >)
#endif
#endif

#ifdef OB_CLEAR_MEM
GIOP_RequestHeader::GIOP_RequestHeader()
{
    memset(&request_id, 0, sizeof(request_id));
    memset(&response_expected, 0, sizeof(response_expected));
    memset(&reserved, 0, sizeof(reserved));
}
#endif

GIOP_RequestHeader::GIOP_RequestHeader(const GIOP_RequestHeader& _ob_a)
    : service_context(_ob_a.service_context),
      request_id(_ob_a.request_id),
      response_expected(_ob_a.response_expected),
      object_key(_ob_a.object_key),
      operation(_ob_a.operation),
      requesting_principal(_ob_a.requesting_principal)
{
    OBCopy_OBUnsignedChar_3(_ob_a.reserved, reserved);
}

GIOP_RequestHeader&
GIOP_RequestHeader::operator=(const GIOP_RequestHeader& _ob_a)
{
    if(this != &_ob_a)
    {
        service_context = _ob_a.service_context;
        request_id = _ob_a.request_id;
        response_expected = _ob_a.response_expected;
        OBCopy_OBUnsignedChar_3(_ob_a.reserved, reserved);
        object_key = _ob_a.object_key;
        operation = _ob_a.operation;
        requesting_principal = _ob_a.requesting_principal;
    }
    return *this;
}

void
OBMarshal(const GIOP_RequestHeader& val, CORBA_Octet*& oct)
{
    OBMarshal(val.service_context, oct);
    OBMarshal(val.request_id, oct);
    OBMarshal(val.response_expected, oct);
    OBMarshal_OBUnsignedChar_3(val.reserved, oct);
    OBMarshal(val.object_key, oct);
    OBMarshal(val.operation.in(), oct);
    OBMarshal(val.requesting_principal.in(), oct);
}

void
OBMarshalCount(const GIOP_RequestHeader& val, CORBA_ULong& count)
{
    OBMarshalCount(val.service_context, count);
    OBMarshalCount(val.request_id, count);
    OBMarshalCount(val.response_expected, count);
    OBMarshalCount_OBUnsignedChar_3(val.reserved, count);
    OBMarshalCount(val.object_key, count);
    OBMarshalCount(val.operation.in(), count);
    OBMarshalCount(val.requesting_principal.in(), count);
}

void
OBUnmarshal(GIOP_RequestHeader& val, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshal(val.service_context, coct, swap);
    OBUnmarshal(val.request_id, coct, swap);
    OBUnmarshal(val.response_expected, coct, swap);
    OBUnmarshal_OBUnsignedChar_3(val.reserved, coct, swap);
    OBUnmarshal(val.object_key, coct, swap);
    OBUnmarshal(val.operation.inout(), coct, swap);
    OBUnmarshal(val.requesting_principal.inout(), coct, swap);
}

//
// IDL:omg.org/GIOP/ReplyHeader:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBVarVar< GIOP_ReplyHeader >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBVarVar< GIOP_ReplyHeader >)
#endif
#endif

#ifdef OB_CLEAR_MEM
GIOP_ReplyHeader::GIOP_ReplyHeader()
{
    memset(&request_id, 0, sizeof(request_id));
    memset(&reply_status, 0, sizeof(reply_status));
}
#endif

GIOP_ReplyHeader::GIOP_ReplyHeader(const GIOP_ReplyHeader& _ob_a)
    : service_context(_ob_a.service_context),
      request_id(_ob_a.request_id),
      reply_status(_ob_a.reply_status)
{
}

GIOP_ReplyHeader&
GIOP_ReplyHeader::operator=(const GIOP_ReplyHeader& _ob_a)
{
    if(this != &_ob_a)
    {
        service_context = _ob_a.service_context;
        request_id = _ob_a.request_id;
        reply_status = _ob_a.reply_status;
    }
    return *this;
}

void
OBMarshal(const GIOP_ReplyHeader& val, CORBA_Octet*& oct)
{
    OBMarshal(val.service_context, oct);
    OBMarshal(val.request_id, oct);
    OBMarshal(val.reply_status, oct);
}

void
OBMarshalCount(const GIOP_ReplyHeader& val, CORBA_ULong& count)
{
    OBMarshalCount(val.service_context, count);
    OBMarshalCount(val.request_id, count);
    OBMarshalCount(val.reply_status, count);
}

void
OBUnmarshal(GIOP_ReplyHeader& val, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshal(val.service_context, coct, swap);
    OBUnmarshal(val.request_id, coct, swap);
    OBUnmarshal(val.reply_status, coct, swap);
}

//
// IDL:omg.org/GIOP/CancelRequestHeader:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBFixVar< GIOP_CancelRequestHeader >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBFixVar< GIOP_CancelRequestHeader >)
#endif
#endif

void
OBMarshal(const GIOP_CancelRequestHeader& val, CORBA_Octet*& oct)
{
    OBMarshal(val.request_id, oct);
}

void
OBMarshalCount(const GIOP_CancelRequestHeader& val, CORBA_ULong& count)
{
    OBMarshalCount(val.request_id, count);
}

void
OBUnmarshal(GIOP_CancelRequestHeader& val, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshal(val.request_id, coct, swap);
}

//
// IDL:omg.org/GIOP/LocateRequestHeader:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBVarVar< GIOP_LocateRequestHeader >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBVarVar< GIOP_LocateRequestHeader >)
#endif
#endif

#ifdef OB_CLEAR_MEM
GIOP_LocateRequestHeader::GIOP_LocateRequestHeader()
{
    memset(&request_id, 0, sizeof(request_id));
}
#endif

GIOP_LocateRequestHeader::GIOP_LocateRequestHeader(const GIOP_LocateRequestHeader& _ob_a)
    : request_id(_ob_a.request_id),
      object_key(_ob_a.object_key)
{
}

GIOP_LocateRequestHeader&
GIOP_LocateRequestHeader::operator=(const GIOP_LocateRequestHeader& _ob_a)
{
    if(this != &_ob_a)
    {
        request_id = _ob_a.request_id;
        object_key = _ob_a.object_key;
    }
    return *this;
}

void
OBMarshal(const GIOP_LocateRequestHeader& val, CORBA_Octet*& oct)
{
    OBMarshal(val.request_id, oct);
    OBMarshal(val.object_key, oct);
}

void
OBMarshalCount(const GIOP_LocateRequestHeader& val, CORBA_ULong& count)
{
    OBMarshalCount(val.request_id, count);
    OBMarshalCount(val.object_key, count);
}

void
OBUnmarshal(GIOP_LocateRequestHeader& val, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshal(val.request_id, coct, swap);
    OBUnmarshal(val.object_key, coct, swap);
}

//
// IDL:omg.org/GIOP/LocateReplyHeader:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBFixVar< GIOP_LocateReplyHeader >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBFixVar< GIOP_LocateReplyHeader >)
#endif
#endif

void
OBMarshal(const GIOP_LocateReplyHeader& val, CORBA_Octet*& oct)
{
    OBMarshal(val.request_id, oct);
    OBMarshal(val.locate_status, oct);
}

void
OBMarshalCount(const GIOP_LocateReplyHeader& val, CORBA_ULong& count)
{
    OBMarshalCount(val.request_id, count);
    OBMarshalCount(val.locate_status, count);
}

void
OBUnmarshal(GIOP_LocateReplyHeader& val, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshal(val.request_id, coct, swap);
    OBUnmarshal(val.locate_status, coct, swap);
}

//
// OBUnsignedChar[4]
//
#ifdef OB_use_OBUnsignedChar_4_from_GIOP_h

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBFixArrayVar< OBSlice_OBUnsignedChar_4, OBUnsignedChar, 4 >;
template class OBFixArrayForAny< OBSlice_OBUnsignedChar_4, OBUnsignedChar, 4 >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBFixArrayVar< OBSlice_OBUnsignedChar_4, OBUnsignedChar, 4 >)
#pragma define(OBFixArrayForAny< OBSlice_OBUnsignedChar_4, OBUnsignedChar, 4 >)
#endif
#endif

void
OBMarshal_OBUnsignedChar_4(const OBSlice_OBUnsignedChar_4* s, CORBA_Octet*& oct)
{
    OBMarshalMulti(s, oct, 4);
}

void
OBMarshalCount_OBUnsignedChar_4(const OBSlice_OBUnsignedChar_4* s, CORBA_ULong& count)
{
    OBMarshalCountMulti(s, count, 4);
}

void
OBUnmarshal_OBUnsignedChar_4(OBSlice_OBUnsignedChar_4* s, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshalMulti(s, coct, swap, 4);
}

OBSlice_OBUnsignedChar_4*
OBAlloc_OBUnsignedChar_4()
{
    return new OBUnsignedChar[4];
}

OBSlice_OBUnsignedChar_4*
OBDup_OBUnsignedChar_4(const OBSlice_OBUnsignedChar_4* s)
{
    OBSlice_OBUnsignedChar_4* to = new OBUnsignedChar[4];
    memcpy(to, s, 4 * sizeof(OBUnsignedChar));
    return to;
}

void
OBCopy_OBUnsignedChar_4(const OBSlice_OBUnsignedChar_4* s, OBSlice_OBUnsignedChar_4* to)
{
    memcpy(to, s, 4 * sizeof(OBUnsignedChar));
}

void
OBFree_OBUnsignedChar_4(OBSlice_OBUnsignedChar_4* s)
{
    delete [] s;
}

#endif

//
// OBVarSeq< IOP_ServiceContext >
//
#ifdef OB_use_OBVarSeq_IOP__ServiceContext_from_GIOP_h

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBVarSeq< IOP_ServiceContext >;
template class OBSeqVar< OBVarSeq< IOP_ServiceContext > >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBVarSeq< IOP_ServiceContext >)
#pragma define(OBSeqVar< OBVarSeq< IOP_ServiceContext > >)
#endif
#endif

void
OBMarshal(const OBVarSeq< IOP_ServiceContext >& seq, CORBA_Octet*& oct)
{
    OBMarshal(seq.length(), oct);
    for(CORBA_ULong i = 0 ; i < seq.length() ; i++)
        OBMarshal(seq[i], oct);
}

void
OBMarshalCount(const OBVarSeq< IOP_ServiceContext >& seq, CORBA_ULong& count)
{
    OBMarshalCount(seq.length(), count);
    for(CORBA_ULong i = 0 ; i < seq.length() ; i++)
        OBMarshalCount(seq[i], count);
}

void
OBUnmarshal(OBVarSeq< IOP_ServiceContext >& seq, const CORBA_Octet*& coct, bool swap)
{
    CORBA_ULong len;
    OBUnmarshal(len, coct, swap);
    seq.length(len);
    for(CORBA_ULong i = 0 ; i < len ; i++)
        OBUnmarshal(seq[i], coct, swap);
}

#endif

//
// OBUnsignedChar[3]
//
#ifdef OB_use_OBUnsignedChar_3_from_GIOP_h

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBFixArrayVar< OBSlice_OBUnsignedChar_3, OBUnsignedChar, 3 >;
template class OBFixArrayForAny< OBSlice_OBUnsignedChar_3, OBUnsignedChar, 3 >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBFixArrayVar< OBSlice_OBUnsignedChar_3, OBUnsignedChar, 3 >)
#pragma define(OBFixArrayForAny< OBSlice_OBUnsignedChar_3, OBUnsignedChar, 3 >)
#endif
#endif

void
OBMarshal_OBUnsignedChar_3(const OBSlice_OBUnsignedChar_3* s, CORBA_Octet*& oct)
{
    OBMarshalMulti(s, oct, 3);
}

void
OBMarshalCount_OBUnsignedChar_3(const OBSlice_OBUnsignedChar_3* s, CORBA_ULong& count)
{
    OBMarshalCountMulti(s, count, 3);
}

void
OBUnmarshal_OBUnsignedChar_3(OBSlice_OBUnsignedChar_3* s, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshalMulti(s, coct, swap, 3);
}

OBSlice_OBUnsignedChar_3*
OBAlloc_OBUnsignedChar_3()
{
    return new OBUnsignedChar[3];
}

OBSlice_OBUnsignedChar_3*
OBDup_OBUnsignedChar_3(const OBSlice_OBUnsignedChar_3* s)
{
    OBSlice_OBUnsignedChar_3* to = new OBUnsignedChar[3];
    memcpy(to, s, 3 * sizeof(OBUnsignedChar));
    return to;
}

void
OBCopy_OBUnsignedChar_3(const OBSlice_OBUnsignedChar_3* s, OBSlice_OBUnsignedChar_3* to)
{
    memcpy(to, s, 3 * sizeof(OBUnsignedChar));
}

void
OBFree_OBUnsignedChar_3(OBSlice_OBUnsignedChar_3* s)
{
    delete [] s;
}

#endif

//
// OBFixSeq< OBUnsignedChar >
//
#ifdef OB_use_OBFixSeq_OBUnsignedChar_from_GIOP_h

#endif
