/*
 *  MICO --- a free CORBA implementation
 *  Copyright (C) 1997-98 Kay Roemer & Arno Puder
 *
 *  This file was automatically generated. DO NOT EDIT!
 */

#if !defined(__COSOBJECTIDENTITY_H__) || defined(MICO_NO_TOPLEVEL_MODULES)
#define __COSOBJECTIDENTITY_H__

#ifndef MICO_NO_TOPLEVEL_MODULES
#include <CORBA.h>
#include <mico/throw.h>
#endif

#ifndef MICO_NO_TOPLEVEL_MODULES
MICO_NAMESPACE_DECL CosObjectIdentity {
#endif

#if !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE_CosObjectIdentity)


typedef CORBA::ULong ObjectIdentifier;
class IdentifiableObject;
typedef IdentifiableObject *IdentifiableObject_ptr;
typedef IdentifiableObject_ptr IdentifiableObjectRef;
typedef ObjVar<IdentifiableObject> IdentifiableObject_var;
typedef IdentifiableObject_var IdentifiableObject_out;


// Common definitions for interface IdentifiableObject
class IdentifiableObject : 
  virtual public CORBA::Object
{
  public:
    virtual ~IdentifiableObject();

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef IdentifiableObject_ptr _ptr_type;
    typedef IdentifiableObject_var _var_type;
    #endif

    static IdentifiableObject_ptr _narrow( CORBA::Object_ptr obj );
    static IdentifiableObject_ptr _narrow( CORBA::AbstractBase_ptr obj );
    static IdentifiableObject_ptr _duplicate( IdentifiableObject_ptr _obj )
    {
      CORBA::Object::_duplicate (_obj);
      return _obj;
    }

    static IdentifiableObject_ptr _nil()
    {
      return 0;
    }

    virtual void *_narrow_helper( const char *repoid );
    static vector<CORBA::Narrow_proto> *_narrow_helpers;
    static bool _narrow_helper2( CORBA::Object_ptr obj );

    virtual ObjectIdentifier constant_random_id() = 0;

    virtual CORBA::Boolean is_identical( IdentifiableObject_ptr other_object ) = 0;

  protected:
    IdentifiableObject() {};
  private:
    IdentifiableObject( const IdentifiableObject& );
    void operator=( const IdentifiableObject& );
};

// Stub for interface IdentifiableObject
class IdentifiableObject_stub:
  virtual public IdentifiableObject
{
  public:
    virtual ~IdentifiableObject_stub();
    ObjectIdentifier constant_random_id();

    CORBA::Boolean is_identical( IdentifiableObject_ptr other_object );

  private:
    void operator=( const IdentifiableObject_stub& );
};

#ifndef MICO_CONF_NO_POA

class IdentifiableObject_stub_clp :
  virtual public IdentifiableObject_stub,
  virtual public PortableServer::StubBase
{
  public:
    IdentifiableObject_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~IdentifiableObject_stub_clp ();
    ObjectIdentifier constant_random_id();

    CORBA::Boolean is_identical( IdentifiableObject_ptr other_object );

  protected:
    IdentifiableObject_stub_clp ();
  private:
    void operator=( const IdentifiableObject_stub_clp & );
};

#endif // MICO_CONF_NO_POA

#endif // !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE_CosObjectIdentity)

#ifndef MICO_NO_TOPLEVEL_MODULES

};
#endif



#ifndef MICO_CONF_NO_POA

#ifndef MICO_NO_TOPLEVEL_MODULES
MICO_NAMESPACE_DECL POA_CosObjectIdentity {
#endif

#if !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE_POA_CosObjectIdentity)


class IdentifiableObject : virtual public PortableServer::StaticImplementation
{
  public:
    virtual ~IdentifiableObject ();
    CosObjectIdentity::IdentifiableObject_ptr _this ();
    bool dispatch (CORBA::StaticServerRequest_ptr);
    virtual void invoke (CORBA::StaticServerRequest_ptr);
    virtual CORBA::Boolean _is_a (const char *);
    virtual CORBA::InterfaceDef_ptr _get_interface ();
    virtual CORBA::RepositoryId _primary_interface (const PortableServer::ObjectId &, PortableServer::POA_ptr);

    virtual void * _narrow_helper (const char *);
    static IdentifiableObject * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual CosObjectIdentity::ObjectIdentifier constant_random_id() = 0;

    virtual CORBA::Boolean is_identical( CosObjectIdentity::IdentifiableObject_ptr other_object ) = 0;

  protected:
    IdentifiableObject () {};

  private:
    IdentifiableObject (const IdentifiableObject &);
    void operator= (const IdentifiableObject &);
};

#ifdef HAVE_NAMESPACE

template<class T>
class IdentifiableObject_tie : 
  virtual public POA_Tie_Base<T>,
  virtual public IdentifiableObject
{
  public:
    IdentifiableObject_tie (T &t)
      : POA_Tie_Base<T> (&t, PortableServer::POA::_nil(), FALSE)
    {}
    IdentifiableObject_tie (T &t, PortableServer::POA_ptr _poa)
      : POA_Tie_Base<T> (&t, _poa, FALSE)
    {}
    IdentifiableObject_tie (T *t, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, PortableServer::POA::_nil(), _rel)
    {}
    IdentifiableObject_tie (T *t, PortableServer::POA_ptr _poa, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, _poa, _rel)
    {}
    virtual ~IdentifiableObject_tie ();

    PortableServer::POA_ptr _default_POA ();

    CosObjectIdentity::ObjectIdentifier constant_random_id();

    CORBA::Boolean is_identical( CosObjectIdentity::IdentifiableObject_ptr other_object );

  protected:
    IdentifiableObject_tie () {};

  private:
    IdentifiableObject_tie (const IdentifiableObject_tie<T> &);
    void operator= (const IdentifiableObject_tie<T> &);
};

template<class T>
IdentifiableObject_tie<T>::~IdentifiableObject_tie ()
{
}

template<class T>
PortableServer::POA_ptr
IdentifiableObject_tie<T>::_default_POA ()
{
  if (!CORBA::is_nil (POA_Tie_Base<T>::poa)) {
    return PortableServer::POA::_duplicate (POA_Tie_Base<T>::poa);
  }
  return PortableServer::ServantBase::_default_POA ();
}

template<class T>
CosObjectIdentity::ObjectIdentifier
IdentifiableObject_tie<T>::constant_random_id ()
{
  return POA_Tie_Base<T>::ptr->constant_random_id ();
}

template<class T>
CORBA::Boolean
IdentifiableObject_tie<T>::is_identical (CosObjectIdentity::IdentifiableObject_ptr other_object)
{
  return POA_Tie_Base<T>::ptr->is_identical (other_object);
}

#endif

#endif // !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE_POA_CosObjectIdentity)

#ifndef MICO_NO_TOPLEVEL_MODULES

};
#endif



#ifndef HAVE_NAMESPACE

template<class T>
class POA_CosObjectIdentity_IdentifiableObject_tie : 
  virtual public POA_Tie_Base<T>,
  virtual public POA_CosObjectIdentity::IdentifiableObject
{
  public:
    POA_CosObjectIdentity_IdentifiableObject_tie (T &t)
      : POA_Tie_Base<T> (&t, PortableServer::POA::_nil(), FALSE)
    {}
    POA_CosObjectIdentity_IdentifiableObject_tie (T &t, PortableServer::POA_ptr _poa)
      : POA_Tie_Base<T> (&t, _poa, FALSE)
    {}
    POA_CosObjectIdentity_IdentifiableObject_tie (T *t, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, PortableServer::POA::_nil(), _rel)
    {}
    POA_CosObjectIdentity_IdentifiableObject_tie (T *t, PortableServer::POA_ptr _poa, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, _poa, _rel)
    {}
    virtual ~POA_CosObjectIdentity_IdentifiableObject_tie ();

    PortableServer::POA_ptr _default_POA ();

    CosObjectIdentity::ObjectIdentifier constant_random_id();

    CORBA::Boolean is_identical( CosObjectIdentity::IdentifiableObject_ptr other_object );

  protected:
    POA_CosObjectIdentity_IdentifiableObject_tie () {};

  private:
    POA_CosObjectIdentity_IdentifiableObject_tie (const POA_CosObjectIdentity_IdentifiableObject_tie<T> &);
    void operator= (const POA_CosObjectIdentity_IdentifiableObject_tie<T> &);
};

template<class T>
POA_CosObjectIdentity_IdentifiableObject_tie<T>::~POA_CosObjectIdentity_IdentifiableObject_tie ()
{
}

template<class T>
PortableServer::POA_ptr
POA_CosObjectIdentity_IdentifiableObject_tie<T>::_default_POA ()
{
  if (!CORBA::is_nil (POA_Tie_Base<T>::poa)) {
    return PortableServer::POA::_duplicate (POA_Tie_Base<T>::poa);
  }
  return PortableServer::ServantBase::_default_POA ();
}

template<class T>
CosObjectIdentity::ObjectIdentifier
POA_CosObjectIdentity_IdentifiableObject_tie<T>::constant_random_id ()
{
  return POA_Tie_Base<T>::ptr->constant_random_id ();
}

template<class T>
CORBA::Boolean
POA_CosObjectIdentity_IdentifiableObject_tie<T>::is_identical (CosObjectIdentity::IdentifiableObject_ptr other_object)
{
  return POA_Tie_Base<T>::ptr->is_identical (other_object);
}

#endif

#endif // MICO_CONF_NO_POA

#if !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE__GLOBAL)

extern CORBA::StaticTypeInfo *_marshaller_CosObjectIdentity_IdentifiableObject;

#endif // !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE__GLOBAL)


#if !defined(MICO_NO_TOPLEVEL_MODULES) && !defined(MICO_IN_GENERATED_CODE)
#include <mico/template_impl.h>
#endif

#endif
