// **********************************************************************
//
// 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/Dynamic.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/CORBA/WrongTransaction:1.0
//
CORBA_WrongTransaction::CORBA_WrongTransaction(const CORBA_WrongTransaction& _ob_a)
    : CORBA_UserException(_ob_a)
{
}

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

CORBA_WrongTransaction*
CORBA_WrongTransaction::_narrow(CORBA_Exception* p)
{
#ifdef HAVE_NO_RTTI
    if(p)
        return (CORBA_WrongTransaction*)(p -> _OB_narrowHelp("IDL:omg.org/CORBA/WrongTransaction:1.0"));
    else
        return 0;
#else
    return dynamic_cast<CORBA_WrongTransaction*>(p);
#endif
}

#ifdef HAVE_NO_RTTI
void*
CORBA_WrongTransaction::_OB_narrowHelp(const char* _ob_id) const
{
    if(strcmp("IDL:omg.org/CORBA/WrongTransaction:1.0", _ob_id) == 0)
        return (void*)this;
    else
        return CORBA_UserException::_OB_narrowHelp(_ob_id);
}
#endif

const char*
CORBA_WrongTransaction::_OB_typeId() const
{
    return "IDL:omg.org/CORBA/WrongTransaction:1.0";
}

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

void
OBMarshal(const CORBA_WrongTransaction&, CORBA_Octet*& oct)
{
    OBMarshal("IDL:omg.org/CORBA/WrongTransaction:1.0", oct);
}

void
OBMarshalCount(const CORBA_WrongTransaction&, CORBA_ULong& count)
{
    OBMarshalCount("IDL:omg.org/CORBA/WrongTransaction:1.0", count);
}

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

OBTypeCodeConst CORBA__tc_WrongTransaction(
"01000000160000004c000000010000002700000049444c3a6f6d672e6f72672f434f5242412f5"
"7726f6e675472616e73616374696f6e3a312e3000001100000057726f6e675472616e73616374"
"696f6e0000000000000000"
);

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

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

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

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

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