// **********************************************************************
//
// 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/ImplRep.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/ImplementationDef:1.0
//
#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBObjVar< CORBA_ImplementationDef >;
template class OBObjForSeq< CORBA_ImplementationDef >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBObjVar< CORBA_ImplementationDef >)
#pragma define(OBObjForSeq< CORBA_ImplementationDef >)
#endif
#endif

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

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

CORBA_ImplementationDef_ptr
CORBA_ImplementationDef::_narrow(CORBA_Object_ptr p)
{
    if(!CORBA_is_nil(p))
    {
        void* v = p -> _OB_narrowHelp("IDL:omg.org/CORBA/ImplementationDef:1.0");

        if(v)
            return _duplicate((CORBA_ImplementationDef_ptr)v);

        if(p -> _OB_remoteIsA("IDL:omg.org/CORBA/ImplementationDef:1.0"))
        {
            CORBA_ImplementationDef_ptr val = new CORBA_ImplementationDef;
            val -> _OB_copyFrom(p);
            return val;
        }
    }

    return _nil();
}

void*
CORBA_ImplementationDef::_OB_narrowHelp(const char* _ob_id) const
{
    if(strcmp("IDL:omg.org/CORBA/ImplementationDef:1.0", _ob_id) == 0)
        return (void*)this;
    else
        return CORBA_Object::_OB_narrowHelp(_ob_id);
}

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

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

    if(!CORBA_is_nil(p))
    {
        void* v = p -> _OB_narrowHelp("IDL:omg.org/CORBA/ImplementationDef:1.0");

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

//
// OBBndFixSeq< OBUnsignedChar, 1024 >
//
#ifdef OB_use_OBBndFixSeq_OBUnsignedChar_1024_from_ImplRep_h

#ifndef HAVE_NO_EXPLICIT_TEMPLATES
template class OBBndFixSeq< OBUnsignedChar, 1024 >;
template class OBSeqVar< OBBndFixSeq< OBUnsignedChar, 1024 > >;
#else
#ifdef HAVE_PRAGMA_DEFINE
#pragma define(OBBndFixSeq< OBUnsignedChar, 1024 >)
#pragma define(OBSeqVar< OBBndFixSeq< OBUnsignedChar, 1024 > >)
#endif
#endif

void
OBMarshal(const OBBndFixSeq< OBUnsignedChar, 1024 >& seq, CORBA_Octet*& oct)
{
    OBMarshal(seq.length(), oct);
    OBMarshalMulti(seq.data(), oct, seq.length());
}

void
OBMarshalCount(const OBBndFixSeq< OBUnsignedChar, 1024 >& seq, CORBA_ULong& count)
{
    OBMarshalCount(seq.length(), count);
    OBMarshalCountMulti(seq.data(), count, seq.length());
}

void
OBUnmarshal(OBBndFixSeq< OBUnsignedChar, 1024 >& seq, const CORBA_Octet*& coct, bool swap)
{
    CORBA_ULong len;
    OBUnmarshal(len, coct, swap);
    seq.length(len);
    OBUnmarshalMulti(seq.data(), coct, swap, len);
}

#endif
