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

// Version: 3.0.1
// License: non-commercial

#include <OB/CORBA.h>
#include <OB/TemplateI.h>
#include "msg.h"

//
// IDL:otMessage:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBObjVar< otMessage >;
template class OBObjForSeq< otMessage >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBObjVar< otMessage >)
#pragma define(OBObjForSeq< otMessage >)
#endif
#endif

void
OBDuplicate(otMessage_ptr p)
{
    if(p)
        p -> _OB_incRef();
}

void
OBRelease(otMessage_ptr p)
{
    if(p)
        p -> _OB_decRef();
}

otMessage_ptr
otMessage::_narrow(CORBA_Object_ptr p)
{
    if(!CORBA_is_nil(p))
    {
        void* v = p -> _OB_narrowHelp("IDL:otMessage:1.0");

        if(v)
            return _duplicate((otMessage_ptr)v);

        if(p -> _OB_remoteIsA("IDL:otMessage:1.0"))
        {
            otMessage_ptr val = new otMessage;
            val -> _OB_copyFrom(p);
            return val;
        }
    }

    return _nil();
}

void*
otMessage::_OB_narrowHelp(const char* _ob_id) const
{
    if(strcmp("IDL:otMessage:1.0", _ob_id) == 0)
        return (void*)this;
    else
        return CORBA_Object::_OB_narrowHelp(_ob_id);
}

const char*
otMessage::_OB_typeId() const
{
    return "IDL:otMessage:1.0";
}

void
OBUnmarshal(otMessage_ptr& val, const CORBA_Octet*& coct, bool swap)
{
    otMessage_var old = val;
    CORBA_Object_var p;
    OBUnmarshal(p.inout(), coct, swap);

    if(!CORBA_is_nil(p))
    {
        void* v = p -> _OB_narrowHelp("IDL:otMessage:1.0");

        if(v)
            val = otMessage::_duplicate((otMessage_ptr)v);
        else
        {
            assert_nca(!(p -> _is_local() && p -> _is_dynamic()), OBNCADynamicAsStatic);
            assert(!p -> _is_local());
            val = new otMessage;
            val -> _OB_copyFrom(p);
        }
    }
    else
        val = otMessage::_nil();
}

OBTypeCodeConst _tc_otMessage(
"010000000e0000002a000000010000001200000049444c3a6f744d6573736167653a312e30000"
"0000a0000006f744d65737361676500"
);

void
operator<<=(CORBA_Any& any, otMessage_ptr val)
{
    OBObjAny* o = new OBObjAny;
    o -> b = CORBA_Object::_duplicate(val);
    o -> d = CORBA_Object::_duplicate(val);
    any.replace(_tc_otMessage, o, true);
}

void
operator<<=(CORBA_Any& any, otMessage_ptr* val)
{
    OBObjAny* o = new OBObjAny;
    o -> b = *val;
    o -> d = CORBA_Object::_duplicate(*val);
    any.replace(_tc_otMessage, o, true);
}

CORBA_Boolean
operator>>=(const CORBA_Any& any, otMessage_ptr& val)
{
    if(any.check_type(_tc_otMessage))
    {
        OBObjAny* o = (OBObjAny*)any.value();
        assert(o);

        if(!CORBA_is_nil(o -> d))
        {
            void* v = o -> d -> _OB_narrowHelp("IDL:otMessage:1.0");

            if(v)
                val = (otMessage_ptr)v;
            else
            {
                assert_nca(!(o -> d -> _is_local() && o -> d -> _is_dynamic()), OBNCADynamicAsStatic);
                assert(!o -> d -> _is_local());
                val = new otMessage;
                val -> _OB_copyFrom(o -> d);
                OBObjAny* no = new OBObjAny;
                no -> b = CORBA_Object::_duplicate(o -> b);
                no -> d = val;
                ((CORBA_Any&)any).replace(_tc_otMessage, no, true);
            }
        }
        else
            val = otMessage::_nil();

        return true;
    }
    else
        return false;
}

//
// IDL:otMessage/ElementKind:1.0
//
OBTypeCodeConst otMessage::_tc_ElementKind(
"0100000011000000bb000000010000001e00000049444c3a6f744d6573736167652f456c656d6"
"56e744b696e643a312e300000000c000000456c656d656e744b696e6400080000000d00000042"
"65674f66456c656d656e74000000000d000000456e644f66456c656d656e74000000000800000"
"0496e74656765720008000000426f6f6c65616e000a000000426974537472696e670000000a00"
"0000486578537472696e670000000c0000004f63746574537472696e67000b000000436861725"
"37472696e6700"
);

void
operator<<=(CORBA_Any& any, otMessage::ElementKind val)
{
    any.replace(otMessage::_tc_ElementKind, new CORBA_ULong((CORBA_ULong)val), true);
}

CORBA_Boolean
operator>>=(const CORBA_Any& any, otMessage::ElementKind& val)
{
    if(any.check_type(otMessage::_tc_ElementKind))
    {
        val = (otMessage::ElementKind)(*(CORBA_ULong*)any.value());
        return true;
    }
    else
        return false;
}

//
// IDL:otMessage/Element:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBVarVar< otMessage::Element >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBVarVar< otMessage::Element >)
#endif
#endif

#ifdef OB_CLEAR_MEM
otMessage::Element::Element()
{
    memset(&kind, 0, sizeof(kind));
    memset(&number, 0, sizeof(number));
}
#endif

otMessage::Element::Element(const otMessage::Element& _ob_a)
    : kind(_ob_a.kind),
      identifier(_ob_a.identifier),
      value(_ob_a.value),
      number(_ob_a.number)
{
}

otMessage::Element&
otMessage::Element::operator=(const Element& _ob_a)
{
    if(this != &_ob_a)
    {
        kind = _ob_a.kind;
        identifier = _ob_a.identifier;
        value = _ob_a.value;
        number = _ob_a.number;
    }
    return *this;
}

void
OBMarshal(const otMessage::Element& val, CORBA_Octet*& oct)
{
    OBMarshal(val.kind, oct);
    OBMarshal(val.identifier.in(), oct);
    OBMarshal(val.value.in(), oct);
    OBMarshal(val.number, oct);
}

void
OBMarshalCount(const otMessage::Element& val, CORBA_ULong& count)
{
    OBMarshalCount(val.kind, count);
    OBMarshalCount(val.identifier.in(), count);
    OBMarshalCount(val.value.in(), count);
    OBMarshalCount(val.number, count);
}

void
OBUnmarshal(otMessage::Element& val, const CORBA_Octet*& coct, bool swap)
{
    OBUnmarshal(val.kind, coct, swap);
    OBUnmarshal(val.identifier.inout(), coct, swap);
    OBUnmarshal(val.value.inout(), coct, swap);
    OBUnmarshal(val.number, coct, swap);
}

OBTypeCodeConst otMessage::_tc_Element(
"010000000f00000040010000010000001a00000049444c3a6f744d6573736167652f456c656d6"
"56e743a312e3000000008000000456c656d656e740004000000050000006b696e640000000011"
"000000bb000000010000001e00000049444c3a6f744d6573736167652f456c656d656e744b696"
"e643a312e300000000c000000456c656d656e744b696e6400080000000d0000004265674f6645"
"6c656d656e74000000000d000000456e644f66456c656d656e740000000008000000496e74656"
"765720008000000426f6f6c65616e000a000000426974537472696e670000000a000000486578"
"537472696e670000000c0000004f63746574537472696e67000b00000043686172537472696e6"
"700000b0000006964656e746966696572000012000000000000000600000076616c7565000000"
"1200000000000000070000006e756d626572000003000000"
);

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBInfo< otMessage::Element >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBInfo< otMessage::Element >)
#endif
#endif

void
operator<<=(CORBA_Any& any, otMessage::Element* p)
{
    static const OBInfo< otMessage::Element > info;
    any.replace(otMessage::_tc_Element, p, true, &info);
}

void
operator<<=(CORBA_Any& any, const otMessage::Element& val)
{
    otMessage::Element* p = new otMessage::Element(val);
    static const OBInfo< otMessage::Element > info;
    any.replace(otMessage::_tc_Element, p, true, &info);
}

CORBA_Boolean
operator>>=(const CORBA_Any& any, otMessage::Element*& p)
{
    if(any.check_type(otMessage::_tc_Element))
    {
        if(!any.info())
        {
            const OBBuffer* bufp = (const OBBuffer*)any.value();
            const CORBA_Octet* coct = bufp -> data;
            otMessage::Element* v = new otMessage::Element;
            OBUnmarshal(*v, coct, false);
            (CORBA_Any&)any <<= v;
        }

        p = (otMessage::Element*)any.value();
        return true;
    }
    else
        return false;
}

//
// IDL:otMessage/SerializedMessage:1.0
//
OBTypeCodeConst otMessage::_tc_SerializedMessage(
"01000000150000009c010000010000002400000049444c3a6f744d6573736167652f536572696"
"16c697a65644d6573736167653a312e30001200000053657269616c697a65644d657373616765"
"0000001300000050010000010000000f00000040010000010000001a00000049444c3a6f744d6"
"573736167652f456c656d656e743a312e3000000008000000456c656d656e7400040000000500"
"00006b696e640000000011000000bb000000010000001e00000049444c3a6f744d65737361676"
"52f456c656d656e744b696e643a312e300000000c000000456c656d656e744b696e6400080000"
"000d0000004265674f66456c656d656e74000000000d000000456e644f66456c656d656e74000"
"0000008000000496e74656765720008000000426f6f6c65616e000a000000426974537472696e"
"670000000a000000486578537472696e670000000c0000004f63746574537472696e67000b000"
"00043686172537472696e6700000b0000006964656e7469666965720000120000000000000006"
"00000076616c75650000001200000000000000070000006e756d6265720000030000000000000"
"0"
);

//
// IDL:otMessage/ParameterList:1.0
//
OBTypeCodeConst otMessage::_tc_ParameterList(
"0100000015000000f0010000010000002000000049444c3a6f744d6573736167652f506172616"
"d657465724c6973743a312e30000e000000506172616d657465724c69737400000013000000ac"
"01000001000000150000009c010000010000002400000049444c3a6f744d6573736167652f536"
"57269616c697a65644d6573736167653a312e30001200000053657269616c697a65644d657373"
"6167650000001300000050010000010000000f00000040010000010000001a00000049444c3a6"
"f744d6573736167652f456c656d656e743a312e3000000008000000456c656d656e7400040000"
"00050000006b696e640000000011000000bb000000010000001e00000049444c3a6f744d65737"
"36167652f456c656d656e744b696e643a312e300000000c000000456c656d656e744b696e6400"
"080000000d0000004265674f66456c656d656e74000000000d000000456e644f66456c656d656"
"e740000000008000000496e74656765720008000000426f6f6c65616e000a0000004269745374"
"72696e670000000a000000486578537472696e670000000c0000004f63746574537472696e670"
"00b00000043686172537472696e6700000b0000006964656e7469666965720000120000000000"
"00000600000076616c75650000001200000000000000070000006e756d6265720000030000000"
"000000000000000"
);

//
// IDL:otMessage/MessageList:1.0
//
OBTypeCodeConst otMessage::_tc_MessageList(
"010000001500000050000000010000001e00000049444c3a6f744d6573736167652f4d6573736"
"167654c6973743a312e300000000c0000004d6573736167654c69737400130000001000000001"
"000000120000000000000000000000"
);

//
// IDL:otMessage/NotImplemented:1.0
//
otMessage::NotImplemented::NotImplemented(const otMessage::NotImplemented& _ob_a)
    : CORBA_UserException(_ob_a)
{
}

otMessage::NotImplemented&
otMessage::NotImplemented::operator=(const NotImplemented&)
{
    return *this;
}

otMessage::NotImplemented*
otMessage::NotImplemented::_narrow(CORBA_Exception* p)
{
#ifdef HAVE_NO_RTTI
    if(p)
        return (NotImplemented*)(p -> _OB_narrowHelp("IDL:otMessage/NotImplemented:1.0"));
    else
        return 0;
#else
    return dynamic_cast<otMessage::NotImplemented*>(p);
#endif
}

#ifdef HAVE_NO_RTTI
void*
otMessage::NotImplemented::_OB_narrowHelp(const char* _ob_id) const
{
    if(strcmp("IDL:otMessage/NotImplemented:1.0", _ob_id) == 0)
        return (void*)this;
    else
        return CORBA_UserException::_OB_narrowHelp(_ob_id);
}
#endif

const char*
otMessage::NotImplemented::_OB_typeId() const
{
    return "IDL:otMessage/NotImplemented:1.0";
}

CORBA_Exception*
otMessage::NotImplemented::_OB_clone() const
{
    return new NotImplemented(*this);
}

void
OBMarshal(const otMessage::NotImplemented&, CORBA_Octet*& oct)
{
    OBMarshal("IDL:otMessage/NotImplemented:1.0", oct);
}

void
OBMarshalCount(const otMessage::NotImplemented&, CORBA_ULong& count)
{
    OBMarshalCount("IDL:otMessage/NotImplemented:1.0", count);
}

void
OBUnmarshal(otMessage::NotImplemented&, const CORBA_Octet*& coct, bool swap)
{
    CORBA_String_var id;
    OBUnmarshal(id.inout(), coct, swap);
    assert(strcmp(id, "IDL:otMessage/NotImplemented:1.0") == 0);
}

OBTypeCodeConst otMessage::_tc_NotImplemented(
"010000001600000044000000010000002100000049444c3a6f744d6573736167652f4e6f74496"
"d706c656d656e7465643a312e30000000000f0000004e6f74496d706c656d656e746564000000"
"000000"
);

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBInfo< otMessage::NotImplemented >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBInfo< otMessage::NotImplemented >)
#endif
#endif

void
operator<<=(CORBA_Any& any, otMessage::NotImplemented* p)
{
    static const OBInfo< otMessage::NotImplemented > info;
    any.replace(otMessage::_tc_NotImplemented, p, true, &info);
}

void
operator<<=(CORBA_Any& any, const otMessage::NotImplemented& val)
{
    otMessage::NotImplemented* p = new otMessage::NotImplemented(val);
    static const OBInfo< otMessage::NotImplemented > info;
    any.replace(otMessage::_tc_NotImplemented, p, true, &info);
}

CORBA_Boolean
operator>>=(const CORBA_Any& any, otMessage::NotImplemented*& p)
{
    if(any.check_type(otMessage::_tc_NotImplemented))
    {
        if(!any.info())
        {
            const OBBuffer* bufp = (const OBBuffer*)any.value();
            const CORBA_Octet* coct = bufp -> data;
            otMessage::NotImplemented* v = new otMessage::NotImplemented;
            OBUnmarshal(*v, coct, false);
            (CORBA_Any&)any <<= v;
        }

        p = (otMessage::NotImplemented*)any.value();
        return true;
    }
    else
        return false;
}

//
// IDL:otMessage/DecodeError:1.0
//
otMessage::DecodeError::DecodeError(const otMessage::DecodeError& _ob_a)
    : CORBA_UserException(_ob_a)
{
}

otMessage::DecodeError&
otMessage::DecodeError::operator=(const DecodeError&)
{
    return *this;
}

otMessage::DecodeError*
otMessage::DecodeError::_narrow(CORBA_Exception* p)
{
#ifdef HAVE_NO_RTTI
    if(p)
        return (DecodeError*)(p -> _OB_narrowHelp("IDL:otMessage/DecodeError:1.0"));
    else
        return 0;
#else
    return dynamic_cast<otMessage::DecodeError*>(p);
#endif
}

#ifdef HAVE_NO_RTTI
void*
otMessage::DecodeError::_OB_narrowHelp(const char* _ob_id) const
{
    if(strcmp("IDL:otMessage/DecodeError:1.0", _ob_id) == 0)
        return (void*)this;
    else
        return CORBA_UserException::_OB_narrowHelp(_ob_id);
}
#endif

const char*
otMessage::DecodeError::_OB_typeId() const
{
    return "IDL:otMessage/DecodeError:1.0";
}

CORBA_Exception*
otMessage::DecodeError::_OB_clone() const
{
    return new DecodeError(*this);
}

void
OBMarshal(const otMessage::DecodeError&, CORBA_Octet*& oct)
{
    OBMarshal("IDL:otMessage/DecodeError:1.0", oct);
}

void
OBMarshalCount(const otMessage::DecodeError&, CORBA_ULong& count)
{
    OBMarshalCount("IDL:otMessage/DecodeError:1.0", count);
}

void
OBUnmarshal(otMessage::DecodeError&, const CORBA_Octet*& coct, bool swap)
{
    CORBA_String_var id;
    OBUnmarshal(id.inout(), coct, swap);
    assert(strcmp(id, "IDL:otMessage/DecodeError:1.0") == 0);
}

OBTypeCodeConst otMessage::_tc_DecodeError(
"01000000160000003c000000010000001e00000049444c3a6f744d6573736167652f4465636f6"
"4654572726f723a312e300000000c0000004465636f64654572726f720000000000"
);

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBInfo< otMessage::DecodeError >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBInfo< otMessage::DecodeError >)
#endif
#endif

void
operator<<=(CORBA_Any& any, otMessage::DecodeError* p)
{
    static const OBInfo< otMessage::DecodeError > info;
    any.replace(otMessage::_tc_DecodeError, p, true, &info);
}

void
operator<<=(CORBA_Any& any, const otMessage::DecodeError& val)
{
    otMessage::DecodeError* p = new otMessage::DecodeError(val);
    static const OBInfo< otMessage::DecodeError > info;
    any.replace(otMessage::_tc_DecodeError, p, true, &info);
}

CORBA_Boolean
operator>>=(const CORBA_Any& any, otMessage::DecodeError*& p)
{
    if(any.check_type(otMessage::_tc_DecodeError))
    {
        if(!any.info())
        {
            const OBBuffer* bufp = (const OBBuffer*)any.value();
            const CORBA_Octet* coct = bufp -> data;
            otMessage::DecodeError* v = new otMessage::DecodeError;
            OBUnmarshal(*v, coct, false);
            (CORBA_Any&)any <<= v;
        }

        p = (otMessage::DecodeError*)any.value();
        return true;
    }
    else
        return false;
}

//
// IDL:otMessage/send:1.0
//
void
otMessage::send(const char* _ob_a0,
                const SerializedMessage& _ob_a1)
{
    if(CORBA_is_nil(_ob_clt_))
        throw CORBA_NO_IMPLEMENT();

    CORBA_ULong _ob_off = _ob_clt_ -> offset(this, "send");
    CORBA_ULong _ob_cnt = _ob_off;
    OBMarshalCount(_ob_a0, _ob_cnt);
    OBMarshalCount(_ob_a1, _ob_cnt);

    OBBuffer _ob_buf(_ob_cnt);
    CORBA_Octet* _ob_o = _ob_buf.data + _ob_off;
    OBMarshal(_ob_a0, _ob_o);
    OBMarshal(_ob_a1, _ob_o);

    bool _ob_sw, _ob_ex, _ob_fo;
    _ob_off = _ob_clt_ -> request(this, "send", _ob_buf, _ob_sw, _ob_ex, _ob_fo, _ob_tout_);

    const CORBA_Octet* _ob_co = _ob_buf.data + _ob_off;

    if(_ob_fo)
    {
        _OB_forward(_ob_co, _ob_sw);
        send(_ob_a0, _ob_a1);
        return;
    }

    if(_ob_ex)
    {
        CORBA_String_var _ob_id;
        const CORBA_Octet* _ob_coid = _ob_co;
        OBUnmarshal(_ob_id.inout(), _ob_coid, _ob_sw);

        if(strcmp(_ob_id, "IDL:otMessage/NotImplemented:1.0") == 0)
        {
            NotImplemented _ob_except;
            OBUnmarshal(_ob_except, _ob_co, _ob_sw);

            throw _ob_except;
        }
        else if(strcmp(_ob_id, "IDL:otMessage/DecodeError:1.0") == 0)
        {
            DecodeError _ob_except;
            OBUnmarshal(_ob_except, _ob_co, _ob_sw);

            throw _ob_except;
        }
        else
            throw CORBA_UNKNOWN();
    }
}

//
// IDL:otMessage/sendTwoWay:1.0
//
otMessage::SerializedMessage*
otMessage::sendTwoWay(const char* _ob_a0,
                      const ParameterList& _ob_a1)
{
    if(CORBA_is_nil(_ob_clt_))
        throw CORBA_NO_IMPLEMENT();

    CORBA_ULong _ob_off = _ob_clt_ -> offset(this, "sendTwoWay");
    CORBA_ULong _ob_cnt = _ob_off;
    OBMarshalCount(_ob_a0, _ob_cnt);
    OBMarshalCount(_ob_a1, _ob_cnt);

    OBBuffer _ob_buf(_ob_cnt);
    CORBA_Octet* _ob_o = _ob_buf.data + _ob_off;
    OBMarshal(_ob_a0, _ob_o);
    OBMarshal(_ob_a1, _ob_o);

    bool _ob_sw, _ob_ex, _ob_fo;
    _ob_off = _ob_clt_ -> request(this, "sendTwoWay", _ob_buf, _ob_sw, _ob_ex, _ob_fo, _ob_tout_);

    const CORBA_Octet* _ob_co = _ob_buf.data + _ob_off;

    if(_ob_fo)
    {
        _OB_forward(_ob_co, _ob_sw);
        return sendTwoWay(_ob_a0, _ob_a1);
    }

    if(_ob_ex)
    {
        CORBA_String_var _ob_id;
        const CORBA_Octet* _ob_coid = _ob_co;
        OBUnmarshal(_ob_id.inout(), _ob_coid, _ob_sw);

        if(strcmp(_ob_id, "IDL:otMessage/NotImplemented:1.0") == 0)
        {
            NotImplemented _ob_except;
            OBUnmarshal(_ob_except, _ob_co, _ob_sw);

            throw _ob_except;
        }
        else if(strcmp(_ob_id, "IDL:otMessage/DecodeError:1.0") == 0)
        {
            DecodeError _ob_except;
            OBUnmarshal(_ob_except, _ob_co, _ob_sw);

            throw _ob_except;
        }
        else
            throw CORBA_UNKNOWN();
    }

    SerializedMessage* _ob_r = new SerializedMessage;
    OBUnmarshal(*_ob_r, _ob_co, _ob_sw);
    return _ob_r;
}

//
// OBVarSeq< otMessage::Element >
//
#ifdef OB_use_OBVarSeq_otMessage_Element_from_msg_h

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

void
OBMarshal(const OBVarSeq< otMessage::Element >& 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< otMessage::Element >& seq, CORBA_ULong& count)
{
    OBMarshalCount(seq.length(), count);
    for(CORBA_ULong i = 0 ; i < seq.length() ; i++)
        OBMarshalCount(seq[i], count);
}

void
OBUnmarshal(OBVarSeq< otMessage::Element >& 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);
}

static OBTypeCodeConst _tc_OBVarSeq_otMessage_Element(
"010000001300000050010000010000000f00000040010000010000001a00000049444c3a6f744"
"d6573736167652f456c656d656e743a312e3000000008000000456c656d656e74000400000005"
"0000006b696e640000000011000000bb000000010000001e00000049444c3a6f744d657373616"
"7652f456c656d656e744b696e643a312e300000000c000000456c656d656e744b696e64000800"
"00000d0000004265674f66456c656d656e74000000000d000000456e644f66456c656d656e740"
"000000008000000496e74656765720008000000426f6f6c65616e000a00000042697453747269"
"6e670000000a000000486578537472696e670000000c0000004f63746574537472696e67000b0"
"0000043686172537472696e6700000b0000006964656e74696669657200001200000000000000"
"0600000076616c75650000001200000000000000070000006e756d62657200000300000000000"
"000"
);

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBInfo< OBVarSeq< otMessage::Element > >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBInfo< OBVarSeq< otMessage::Element > >)
#endif
#endif

void
operator<<=(CORBA_Any& any, OBVarSeq< otMessage::Element >* p)
{
    static const OBInfo< OBVarSeq< otMessage::Element > > info;
    any.replace(_tc_OBVarSeq_otMessage_Element, p, true, &info);
}

void
operator<<=(CORBA_Any& any, const OBVarSeq< otMessage::Element >& seq)
{
    static const OBInfo< OBVarSeq< otMessage::Element > > info;
    OBVarSeq< otMessage::Element >* p = new OBVarSeq< otMessage::Element >(seq);
    any.replace(_tc_OBVarSeq_otMessage_Element, p, true, &info);
}

CORBA_Boolean
operator>>=(const CORBA_Any& any, OBVarSeq< otMessage::Element >*& p)
{
    if(any.check_type(_tc_OBVarSeq_otMessage_Element))
    {
        if(!any.info())
        {
            const OBBuffer* bufp = (const OBBuffer*)any.value();
            const CORBA_Octet* coct = bufp -> data;
            OBVarSeq< otMessage::Element >* v = new OBVarSeq< otMessage::Element >;
            OBUnmarshal(*v, coct, false);
            (CORBA_Any&)any <<= v;
        }

        p = (OBVarSeq< otMessage::Element >*)any.value();
        return true;
    }
    else
        return false;
}

#endif

//
// OBVarSeq< OBVarSeq< otMessage::Element > >
//
#ifdef OB_use_OBVarSeq_OBVarSeq_otMessage_Element_from_msg_h

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

void
OBMarshal(const OBVarSeq< OBVarSeq< otMessage::Element > >& 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< OBVarSeq< otMessage::Element > >& seq, CORBA_ULong& count)
{
    OBMarshalCount(seq.length(), count);
    for(CORBA_ULong i = 0 ; i < seq.length() ; i++)
        OBMarshalCount(seq[i], count);
}

void
OBUnmarshal(OBVarSeq< OBVarSeq< otMessage::Element > >& 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);
}

static OBTypeCodeConst _tc_OBVarSeq_OBVarSeq_otMessage_Element(
"0100000013000000ac01000001000000150000009c010000010000002400000049444c3a6f744"
"d6573736167652f53657269616c697a65644d6573736167653a312e3000120000005365726961"
"6c697a65644d6573736167650000001300000050010000010000000f000000400100000100000"
"01a00000049444c3a6f744d6573736167652f456c656d656e743a312e3000000008000000456c"
"656d656e740004000000050000006b696e640000000011000000bb000000010000001e0000004"
"9444c3a6f744d6573736167652f456c656d656e744b696e643a312e300000000c000000456c65"
"6d656e744b696e6400080000000d0000004265674f66456c656d656e74000000000d000000456"
"e644f66456c656d656e740000000008000000496e74656765720008000000426f6f6c65616e00"
"0a000000426974537472696e670000000a000000486578537472696e670000000c0000004f637"
"46574537472696e67000b00000043686172537472696e6700000b0000006964656e7469666965"
"72000012000000000000000600000076616c75650000001200000000000000070000006e756d6"
"265720000030000000000000000000000"
);

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBInfo< OBVarSeq< OBVarSeq< otMessage::Element > > >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBInfo< OBVarSeq< OBVarSeq< otMessage::Element > > >)
#endif
#endif

void
operator<<=(CORBA_Any& any, OBVarSeq< OBVarSeq< otMessage::Element > >* p)
{
    static const OBInfo< OBVarSeq< OBVarSeq< otMessage::Element > > > info;
    any.replace(_tc_OBVarSeq_OBVarSeq_otMessage_Element, p, true, &info);
}

void
operator<<=(CORBA_Any& any, const OBVarSeq< OBVarSeq< otMessage::Element > >& seq)
{
    static const OBInfo< OBVarSeq< OBVarSeq< otMessage::Element > > > info;
    OBVarSeq< OBVarSeq< otMessage::Element > >* p = new OBVarSeq< OBVarSeq< otMessage::Element > >(seq);
    any.replace(_tc_OBVarSeq_OBVarSeq_otMessage_Element, p, true, &info);
}

CORBA_Boolean
operator>>=(const CORBA_Any& any, OBVarSeq< OBVarSeq< otMessage::Element > >*& p)
{
    if(any.check_type(_tc_OBVarSeq_OBVarSeq_otMessage_Element))
    {
        if(!any.info())
        {
            const OBBuffer* bufp = (const OBBuffer*)any.value();
            const CORBA_Octet* coct = bufp -> data;
            OBVarSeq< OBVarSeq< otMessage::Element > >* v = new OBVarSeq< OBVarSeq< otMessage::Element > >;
            OBUnmarshal(*v, coct, false);
            (CORBA_Any&)any <<= v;
        }

        p = (OBVarSeq< OBVarSeq< otMessage::Element > >*)any.value();
        return true;
    }
    else
        return false;
}

#endif

//
// OBStrSeq
//
#ifdef OB_use_OBStrSeq_from_msg_h

static OBTypeCodeConst _tc_OBStrSeq(
"01000000130000001000000001000000120000000000000000000000"
);

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBInfo< OBStrSeq >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBInfo< OBStrSeq >)
#endif
#endif

void
operator<<=(CORBA_Any& any, OBStrSeq* p)
{
    static const OBInfo< OBStrSeq > info;
    any.replace(_tc_OBStrSeq, p, true, &info);
}

void
operator<<=(CORBA_Any& any, const OBStrSeq& seq)
{
    static const OBInfo< OBStrSeq > info;
    OBStrSeq* p = new OBStrSeq(seq);
    any.replace(_tc_OBStrSeq, p, true, &info);
}

CORBA_Boolean
operator>>=(const CORBA_Any& any, OBStrSeq*& p)
{
    if(any.check_type(_tc_OBStrSeq))
    {
        if(!any.info())
        {
            const OBBuffer* bufp = (const OBBuffer*)any.value();
            const CORBA_Octet* coct = bufp -> data;
            OBStrSeq* v = new OBStrSeq;
            OBUnmarshal(*v, coct, false);
            (CORBA_Any&)any <<= v;
        }

        p = (OBStrSeq*)any.value();
        return true;
    }
    else
        return false;
}

#endif
