// -*- C++ -*-
//
// IORTableC.cpp,v 1.17 2003/12/28 16:11:44 jwillemsen Exp

// ****  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/
// and
//       Institute for Software Integrated Systems
//       Vanderbilt University
//       Nashville, TN
//       USA
//       http://www.isis.vanderbilt.edu/
//
// Information about TAO is available at:
//     http://www.cs.wustl.edu/~schmidt/TAO.html

// TAO_IDL - Generated from
// be/be_codegen.cpp:301


#include "IORTableC.h"
#include "tao/Stub.h"
#include "tao/Invocation_Adapter.h"
#include "tao/Object_T.h"
#include "tao/Basic_Arguments.h"
#include "tao/Object_Argument_T.h"
#include "tao/UB_String_Arguments.h"
#include "ace/OS_NS_string.h"

#if defined (__BORLANDC__)
#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig
#endif /* __BORLANDC__ */

#if !defined (__ACE_INLINE__)
#include "IORTableC.i"
#endif /* !defined INLINE */

// TAO_IDL - Generated from
// be/be_visitor_arg_traits.cpp:59

// Arg traits specializations.
namespace TAO
{

#if !defined (_IORTABLE_LOCATOR__ARG_TRAITS_CS_)
#define _IORTABLE_LOCATOR__ARG_TRAITS_CS_

  ACE_TEMPLATE_SPECIALIZATION
  class TAO_IORTable_Export Arg_Traits<IORTable::Locator>
    : public
        Object_Arg_Traits_T<
            IORTable::Locator_ptr,
            IORTable::Locator_var,
            IORTable::Locator_out,
            TAO::Objref_Traits<IORTable::Locator>
          >
  {
  };

#endif /* end #if !defined */

#if !defined (_IORTABLE_LOCATOR__ARG_TRAITS_CS_)
#define _IORTABLE_LOCATOR__ARG_TRAITS_CS_

  ACE_TEMPLATE_SPECIALIZATION
  class TAO_IORTable_Export Arg_Traits<IORTable::Locator>
    : public
        Object_Arg_Traits_T<
            IORTable::Locator_ptr,
            IORTable::Locator_var,
            IORTable::Locator_out,
            TAO::Objref_Traits<IORTable::Locator>
          >
  {
  };

#endif /* end #if !defined */
}

// TAO_IDL - Generated from
// be/be_visitor_exception/exception_cs.cpp:63

IORTable::AlreadyBound::AlreadyBound (void)
  : CORBA::UserException (
        "IDL:IORTable/AlreadyBound:1.0",
        "AlreadyBound"
      )
{
}

IORTable::AlreadyBound::~AlreadyBound (void)
{
}

IORTable::AlreadyBound::AlreadyBound (const ::IORTable::AlreadyBound &_tao_excp)
  : CORBA::UserException (
        _tao_excp._rep_id (),
        _tao_excp._name ()
      )
{
}

IORTable::AlreadyBound&
IORTable::AlreadyBound::operator= (const ::IORTable::AlreadyBound &_tao_excp)
{
  this->ACE_NESTED_CLASS (CORBA, UserException)::operator= (_tao_excp);
  return *this;
}

IORTable::AlreadyBound *
IORTable::AlreadyBound::_downcast (CORBA::Exception *_tao_excp)
{
  if (!ACE_OS::strcmp ("IDL:IORTable/AlreadyBound:1.0", _tao_excp->_rep_id ()))
    {
      return ACE_dynamic_cast (AlreadyBound *, _tao_excp);
    }
  else
    {
      return 0;
    }
}

CORBA::Exception *IORTable::AlreadyBound::_alloc (void)
{
  CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::IORTable::AlreadyBound, 0);
  return retval;
}

CORBA::Exception *
IORTable::AlreadyBound::_tao_duplicate (void) const
{
  CORBA::Exception *result;
  ACE_NEW_RETURN (
      result,
      ::IORTable::AlreadyBound (*this),
      0
    );
  return result;
}

void IORTable::AlreadyBound::_raise (void) const
{
  TAO_RAISE (*this);
}

void IORTable::AlreadyBound::_tao_encode (
    TAO_OutputCDR &cdr
    ACE_ENV_ARG_DECL
  ) const
{
  if (cdr << *this)
    {
      return;
    }

  ACE_THROW (CORBA::MARSHAL ());
}

void IORTable::AlreadyBound::_tao_decode (
    TAO_InputCDR &cdr
    ACE_ENV_ARG_DECL
  )
{
  if (cdr >> *this)
    {
      return;
    }

  ACE_THROW (CORBA::MARSHAL ());
}



// TAO_IDL - Generated from
// be/be_visitor_exception/exception_cs.cpp:63

IORTable::NotFound::NotFound (void)
  : CORBA::UserException (
        "IDL:IORTable/NotFound:1.0",
        "NotFound"
      )
{
}

IORTable::NotFound::~NotFound (void)
{
}

IORTable::NotFound::NotFound (const ::IORTable::NotFound &_tao_excp)
  : CORBA::UserException (
        _tao_excp._rep_id (),
        _tao_excp._name ()
      )
{
}

IORTable::NotFound&
IORTable::NotFound::operator= (const ::IORTable::NotFound &_tao_excp)
{
  this->ACE_NESTED_CLASS (CORBA, UserException)::operator= (_tao_excp);
  return *this;
}

IORTable::NotFound *
IORTable::NotFound::_downcast (CORBA::Exception *_tao_excp)
{
  if (!ACE_OS::strcmp ("IDL:IORTable/NotFound:1.0", _tao_excp->_rep_id ()))
    {
      return ACE_dynamic_cast (NotFound *, _tao_excp);
    }
  else
    {
      return 0;
    }
}

CORBA::Exception *IORTable::NotFound::_alloc (void)
{
  CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::IORTable::NotFound, 0);
  return retval;
}

CORBA::Exception *
IORTable::NotFound::_tao_duplicate (void) const
{
  CORBA::Exception *result;
  ACE_NEW_RETURN (
      result,
      ::IORTable::NotFound (*this),
      0
    );
  return result;
}

void IORTable::NotFound::_raise (void) const
{
  TAO_RAISE (*this);
}

void IORTable::NotFound::_tao_encode (
    TAO_OutputCDR &cdr
    ACE_ENV_ARG_DECL
  ) const
{
  if (cdr << *this)
    {
      return;
    }

  ACE_THROW (CORBA::MARSHAL ());
}

void IORTable::NotFound::_tao_decode (
    TAO_InputCDR &cdr
    ACE_ENV_ARG_DECL
  )
{
  if (cdr >> *this)
    {
      return;
    }

  ACE_THROW (CORBA::MARSHAL ());
}



// TAO_IDL - Generated from
// be/be_visitor_interface/interface_cs.cpp:60

// Traits specializations for IORTable::Table.

IORTable::Table_ptr
TAO::Objref_Traits<IORTable::Table>::tao_duplicate (
    IORTable::Table_ptr p
  )
{
  return IORTable::Table::_duplicate (p);
}

void
TAO::Objref_Traits<IORTable::Table>::tao_release (
    IORTable::Table_ptr p
  )
{
  CORBA::release (p);
}

IORTable::Table_ptr
TAO::Objref_Traits<IORTable::Table>::tao_nil (void)
{
  return IORTable::Table::_nil ();
}

CORBA::Boolean
TAO::Objref_Traits<IORTable::Table>::tao_marshal (
    IORTable::Table_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return p->marshal (cdr);
}

// Function pointer for collocation factory initialization.
TAO::Collocation_Proxy_Broker *
(*IORTable__TAO_Table_Proxy_Broker_Factory_function_pointer) (
    CORBA::Object_ptr obj
  ) = 0;

IORTable::Table::Table (void)
{}

IORTable::Table::~Table (void)
{}

IORTable::Table_ptr
IORTable::Table::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  Table_ptr proxy =
    dynamic_cast<Table_ptr> (_tao_objref);
  proxy->_add_ref ();
  return proxy;
}

IORTable::Table_ptr
IORTable::Table::_duplicate (Table_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }

  return obj;
}

CORBA::Boolean
IORTable::Table::_is_a (
    const char *value
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:IORTable/Table:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/LocalObject:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/Object:1.0"
        )
     )
    {
      return 1; // success using local knowledge
    }
  else
    {
      return 0;
    }
}

const char* IORTable::Table::_interface_repository_id (void) const
{
  return "IDL:IORTable/Table:1.0";
}

CORBA::Boolean
IORTable::Table::marshal (TAO_OutputCDR &)
{
  return 0;
}

// TAO_IDL - Generated from
// be/be_visitor_interface/interface_cs.cpp:60

// Traits specializations for IORTable::Locator.

IORTable::Locator_ptr
TAO::Objref_Traits<IORTable::Locator>::tao_duplicate (
    IORTable::Locator_ptr p
  )
{
  return IORTable::Locator::_duplicate (p);
}

void
TAO::Objref_Traits<IORTable::Locator>::tao_release (
    IORTable::Locator_ptr p
  )
{
  CORBA::release (p);
}

IORTable::Locator_ptr
TAO::Objref_Traits<IORTable::Locator>::tao_nil (void)
{
  return IORTable::Locator::_nil ();
}

CORBA::Boolean
TAO::Objref_Traits<IORTable::Locator>::tao_marshal (
    IORTable::Locator_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return p->marshal (cdr);
}

// Function pointer for collocation factory initialization.
TAO::Collocation_Proxy_Broker *
(*IORTable__TAO_Locator_Proxy_Broker_Factory_function_pointer) (
    CORBA::Object_ptr obj
  ) = 0;

IORTable::Locator::Locator (void)
{}

IORTable::Locator::~Locator (void)
{}

IORTable::Locator_ptr
IORTable::Locator::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  Locator_ptr proxy =
    dynamic_cast<Locator_ptr> (_tao_objref);
  proxy->_add_ref ();
  return proxy;
}

IORTable::Locator_ptr
IORTable::Locator::_duplicate (Locator_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }

  return obj;
}

CORBA::Boolean
IORTable::Locator::_is_a (
    const char *value
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:IORTable/Locator:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/LocalObject:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/Object:1.0"
        )
     )
    {
      return 1; // success using local knowledge
    }
  else
    {
      return 0;
    }
}

const char* IORTable::Locator::_interface_repository_id (void) const
{
  return "IDL:IORTable/Locator:1.0";
}

CORBA::Boolean
IORTable::Locator::marshal (TAO_OutputCDR &)
{
  return 0;
}

// TAO_IDL - Generated from
// be/be_visitor_root/root.cpp:1703

#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)

  template class
    TAO::Objref_Traits<
        IORTable::Locator
      >;

  template class
    TAO_Objref_Var_T<
        IORTable::Locator
      >;

  template class
    TAO_Objref_Out_T<
        IORTable::Locator
      >;

  template class
    TAO::Objref_Traits<
        IORTable::Table
      >;

  template class
    TAO_Objref_Var_T<
        IORTable::Table
      >;

  template class
    TAO_Objref_Out_T<
        IORTable::Table
      >;

#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)

# pragma instantiate \
    TAO::Objref_Traits< \
        IORTable::Locator \
      >

# pragma instantiate \
    TAO_Objref_Var_T< \
        IORTable::Locator
      >

# pragma instantiate \
    TAO_Objref_Out_T< \
        IORTable::Locator
      >

# pragma instantiate \
    TAO::Objref_Traits< \
        IORTable::Table \
      >

# pragma instantiate \
    TAO_Objref_Var_T< \
        IORTable::Table
      >

# pragma instantiate \
    TAO_Objref_Out_T< \
        IORTable::Table
      >

#endif /* !ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
