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

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

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

#ifdef MICO_IN_GENERATED_CODE
#include <mico/ir_base.h>
#else
#define MICO_IN_GENERATED_CODE
#include <mico/ir_base.h>
#undef MICO_IN_GENERATED_CODE
#endif

#ifdef MICO_IN_GENERATED_CODE
#include <mico/ir.h>
#else
#define MICO_IN_GENERATED_CODE
#include <mico/ir.h>
#undef MICO_IN_GENERATED_CODE
#endif

#ifdef MICO_IN_GENERATED_CODE
#include <mico/CosObjectIdentity.h>
#else
#define MICO_IN_GENERATED_CODE
#include <mico/CosObjectIdentity.h>
#undef MICO_IN_GENERATED_CODE
#endif

#ifndef MICO_NO_TOPLEVEL_MODULES
MICO_NAMESPACE_DECL CosRelationships {
#endif

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


typedef CORBA::Object RelatedObject;
typedef CORBA::Object_ptr RelatedObject_ptr;
typedef CORBA::ObjectRef RelatedObjectRef;
typedef CORBA::Object_var RelatedObject_var;
typedef RelatedObject_var RelatedObject_out;

class Role;
typedef Role *Role_ptr;
typedef Role_ptr RoleRef;
typedef ObjVar<Role> Role_var;
typedef Role_var Role_out;

typedef IfaceSequenceTmpl<Role_var,Role_ptr> Roles;
#ifdef _WINDOWS
static Roles _dummy_Roles;
#endif
typedef TSeqVar<IfaceSequenceTmpl<Role_var,Role_ptr> > Roles_var;
typedef Roles_var Roles_out;

typedef char* RoleName;
typedef CORBA::String_var RoleName_var;
typedef CORBA::String_out RoleName_out;

typedef StringSequenceTmpl<CORBA::String_var> RoleNames;
#ifdef _WINDOWS
static RoleNames _dummy_RoleNames;
#endif
typedef TSeqVar<StringSequenceTmpl<CORBA::String_var> > RoleNames_var;
typedef RoleNames_var RoleNames_out;

typedef IfaceSequenceTmpl<CORBA::InterfaceDef_var,CORBA::InterfaceDef_ptr> InterfaceDefs;
#ifdef _WINDOWS
static InterfaceDefs _dummy_InterfaceDefs;
#endif
typedef TSeqVar<IfaceSequenceTmpl<CORBA::InterfaceDef_var,CORBA::InterfaceDef_ptr> > InterfaceDefs_var;
typedef InterfaceDefs_var InterfaceDefs_out;

struct NamedRole;
typedef TVarVar<NamedRole> NamedRole_var;
typedef NamedRole_var NamedRole_out;

struct NamedRole {
  #ifdef HAVE_TYPEDEF_OVERLOAD
  typedef NamedRole_var _var_type;
  #endif
  #ifdef HAVE_EXPLICIT_STRUCT_OPS
  NamedRole();
  ~NamedRole();
  NamedRole( const NamedRole& s );
  NamedRole& operator=( const NamedRole& s );
  #endif //HAVE_EXPLICIT_STRUCT_OPS

  RoleName_var name;
  Role_var aRole;
};

typedef SequenceTmpl<NamedRole,MICO_TID_DEF> NamedRoles;
#ifdef _WINDOWS
static NamedRoles _dummy_NamedRoles;
#endif
typedef TSeqVar<SequenceTmpl<NamedRole,MICO_TID_DEF> > NamedRoles_var;
typedef NamedRoles_var NamedRoles_out;

class Relationship;
typedef Relationship *Relationship_ptr;
typedef Relationship_ptr RelationshipRef;
typedef ObjVar<Relationship> Relationship_var;
typedef Relationship_var Relationship_out;

struct RelationshipHandle;
typedef TVarVar<RelationshipHandle> RelationshipHandle_var;
typedef RelationshipHandle_var RelationshipHandle_out;

struct RelationshipHandle {
  #ifdef HAVE_TYPEDEF_OVERLOAD
  typedef RelationshipHandle_var _var_type;
  #endif
  #ifdef HAVE_EXPLICIT_STRUCT_OPS
  RelationshipHandle();
  ~RelationshipHandle();
  RelationshipHandle( const RelationshipHandle& s );
  RelationshipHandle& operator=( const RelationshipHandle& s );
  #endif //HAVE_EXPLICIT_STRUCT_OPS

  Relationship_var the_relationship;
  CosObjectIdentity::ObjectIdentifier constant_random_id;
};

typedef SequenceTmpl<RelationshipHandle,MICO_TID_DEF> RelationshipHandles;
#ifdef _WINDOWS
static RelationshipHandles _dummy_RelationshipHandles;
#endif
typedef TSeqVar<SequenceTmpl<RelationshipHandle,MICO_TID_DEF> > RelationshipHandles_var;
typedef RelationshipHandles_var RelationshipHandles_out;

class RelationshipFactory;
typedef RelationshipFactory *RelationshipFactory_ptr;
typedef RelationshipFactory_ptr RelationshipFactoryRef;
typedef ObjVar<RelationshipFactory> RelationshipFactory_var;
typedef RelationshipFactory_var RelationshipFactory_out;


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

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef RelationshipFactory_ptr _ptr_type;
    typedef RelationshipFactory_var _var_type;
    #endif

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

    static RelationshipFactory_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 );

    struct NamedRoleType;
    typedef TVarVar<NamedRoleType> NamedRoleType_var;
    typedef NamedRoleType_var NamedRoleType_out;

    struct NamedRoleType {
      #ifdef HAVE_TYPEDEF_OVERLOAD
      typedef NamedRoleType_var _var_type;
      #endif
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      NamedRoleType();
      ~NamedRoleType();
      NamedRoleType( const NamedRoleType& s );
      NamedRoleType& operator=( const NamedRoleType& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      RoleName_var name;
      CORBA::InterfaceDef_var named_role_type;
    };

    typedef SequenceTmpl<NamedRoleType,MICO_TID_DEF> NamedRoleTypes;
    #ifdef _WINDOWS
    static NamedRoleTypes _dummy_NamedRoleTypes;
    #endif
    typedef TSeqVar<SequenceTmpl<NamedRoleType,MICO_TID_DEF> > NamedRoleTypes_var;
    typedef NamedRoleTypes_var NamedRoleTypes_out;

    struct RoleTypeError : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      RoleTypeError();
      ~RoleTypeError();
      RoleTypeError( const RoleTypeError& s );
      RoleTypeError& operator=( const RoleTypeError& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      RoleTypeError();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      RoleTypeError( const NamedRoles& _m0 );

      #ifdef HAVE_STD_EH
      RoleTypeError *operator->() { return this; }
      RoleTypeError& operator*() { return *this; }
      operator RoleTypeError*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static RoleTypeError *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const RoleTypeError *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      NamedRoles culprits;
    };

    #ifdef HAVE_STD_EH
    typedef RoleTypeError RoleTypeError_catch;
    #else
    typedef ExceptVar<RoleTypeError> RoleTypeError_var;
    typedef RoleTypeError_var RoleTypeError_out;
    typedef RoleTypeError_var RoleTypeError_catch;
    #endif // HAVE_STD_EH

    struct MaxCardinalityExceeded : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      MaxCardinalityExceeded();
      ~MaxCardinalityExceeded();
      MaxCardinalityExceeded( const MaxCardinalityExceeded& s );
      MaxCardinalityExceeded& operator=( const MaxCardinalityExceeded& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      MaxCardinalityExceeded();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      MaxCardinalityExceeded( const NamedRoles& _m0 );

      #ifdef HAVE_STD_EH
      MaxCardinalityExceeded *operator->() { return this; }
      MaxCardinalityExceeded& operator*() { return *this; }
      operator MaxCardinalityExceeded*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static MaxCardinalityExceeded *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const MaxCardinalityExceeded *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      NamedRoles culprits;
    };

    #ifdef HAVE_STD_EH
    typedef MaxCardinalityExceeded MaxCardinalityExceeded_catch;
    #else
    typedef ExceptVar<MaxCardinalityExceeded> MaxCardinalityExceeded_var;
    typedef MaxCardinalityExceeded_var MaxCardinalityExceeded_out;
    typedef MaxCardinalityExceeded_var MaxCardinalityExceeded_catch;
    #endif // HAVE_STD_EH

    struct DegreeError : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      DegreeError();
      ~DegreeError();
      DegreeError( const DegreeError& s );
      DegreeError& operator=( const DegreeError& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      DegreeError();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      DegreeError( CORBA::UShort _m0 );

      #ifdef HAVE_STD_EH
      DegreeError *operator->() { return this; }
      DegreeError& operator*() { return *this; }
      operator DegreeError*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static DegreeError *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const DegreeError *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      CORBA::UShort required_degree;
    };

    #ifdef HAVE_STD_EH
    typedef DegreeError DegreeError_catch;
    #else
    typedef ExceptVar<DegreeError> DegreeError_var;
    typedef DegreeError_var DegreeError_out;
    typedef DegreeError_var DegreeError_catch;
    #endif // HAVE_STD_EH

    struct DuplicateRoleName : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      DuplicateRoleName();
      ~DuplicateRoleName();
      DuplicateRoleName( const DuplicateRoleName& s );
      DuplicateRoleName& operator=( const DuplicateRoleName& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      DuplicateRoleName();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      DuplicateRoleName( const NamedRoles& _m0 );

      #ifdef HAVE_STD_EH
      DuplicateRoleName *operator->() { return this; }
      DuplicateRoleName& operator*() { return *this; }
      operator DuplicateRoleName*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static DuplicateRoleName *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const DuplicateRoleName *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      NamedRoles culprits;
    };

    #ifdef HAVE_STD_EH
    typedef DuplicateRoleName DuplicateRoleName_catch;
    #else
    typedef ExceptVar<DuplicateRoleName> DuplicateRoleName_var;
    typedef DuplicateRoleName_var DuplicateRoleName_out;
    typedef DuplicateRoleName_var DuplicateRoleName_catch;
    #endif // HAVE_STD_EH

    struct UnknownRoleName : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      UnknownRoleName();
      ~UnknownRoleName();
      UnknownRoleName( const UnknownRoleName& s );
      UnknownRoleName& operator=( const UnknownRoleName& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      UnknownRoleName();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      UnknownRoleName( const NamedRoles& _m0 );

      #ifdef HAVE_STD_EH
      UnknownRoleName *operator->() { return this; }
      UnknownRoleName& operator*() { return *this; }
      operator UnknownRoleName*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static UnknownRoleName *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const UnknownRoleName *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      NamedRoles culprits;
    };

    #ifdef HAVE_STD_EH
    typedef UnknownRoleName UnknownRoleName_catch;
    #else
    typedef ExceptVar<UnknownRoleName> UnknownRoleName_var;
    typedef UnknownRoleName_var UnknownRoleName_out;
    typedef UnknownRoleName_var UnknownRoleName_catch;
    #endif // HAVE_STD_EH

    virtual CORBA::InterfaceDef_ptr relationship_type() = 0;
    virtual CORBA::UShort degree() = 0;
    virtual NamedRoleTypes* named_role_types() = 0;

    virtual Relationship_ptr create( const NamedRoles& named_roles ) = 0;

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

// Stub for interface RelationshipFactory
class RelationshipFactory_stub:
  virtual public RelationshipFactory
{
  public:
    virtual ~RelationshipFactory_stub();
    CORBA::InterfaceDef_ptr relationship_type();
    CORBA::UShort degree();
    NamedRoleTypes* named_role_types();

    Relationship_ptr create( const NamedRoles& named_roles );

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

#ifndef MICO_CONF_NO_POA

class RelationshipFactory_stub_clp :
  virtual public RelationshipFactory_stub,
  virtual public PortableServer::StubBase
{
  public:
    RelationshipFactory_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~RelationshipFactory_stub_clp ();
    CORBA::InterfaceDef_ptr relationship_type();
    CORBA::UShort degree();
    NamedRoleTypes* named_role_types();

    Relationship_ptr create( const NamedRoles& named_roles );

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

#endif // MICO_CONF_NO_POA


// Common definitions for interface Relationship
class Relationship : 
  virtual public ::CosObjectIdentity::IdentifiableObject
{
  public:
    virtual ~Relationship();

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef Relationship_ptr _ptr_type;
    typedef Relationship_var _var_type;
    #endif

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

    static Relationship_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 );

    struct CannotUnlink : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      CannotUnlink();
      ~CannotUnlink();
      CannotUnlink( const CannotUnlink& s );
      CannotUnlink& operator=( const CannotUnlink& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      CannotUnlink();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      CannotUnlink( const Roles& _m0 );

      #ifdef HAVE_STD_EH
      CannotUnlink *operator->() { return this; }
      CannotUnlink& operator*() { return *this; }
      operator CannotUnlink*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static CannotUnlink *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const CannotUnlink *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      Roles offending_roles;
    };

    #ifdef HAVE_STD_EH
    typedef CannotUnlink CannotUnlink_catch;
    #else
    typedef ExceptVar<CannotUnlink> CannotUnlink_var;
    typedef CannotUnlink_var CannotUnlink_out;
    typedef CannotUnlink_var CannotUnlink_catch;
    #endif // HAVE_STD_EH

    virtual NamedRoles* named_roles() = 0;

    virtual void destroy() = 0;

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

// Stub for interface Relationship
class Relationship_stub:
  virtual public Relationship,
  virtual public ::CosObjectIdentity::IdentifiableObject_stub
{
  public:
    virtual ~Relationship_stub();
    NamedRoles* named_roles();

    void destroy();

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

#ifndef MICO_CONF_NO_POA

class Relationship_stub_clp :
  virtual public Relationship_stub,
  virtual public ::CosObjectIdentity::IdentifiableObject_stub_clp
{
  public:
    Relationship_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~Relationship_stub_clp ();
    NamedRoles* named_roles();

    void destroy();

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

#endif // MICO_CONF_NO_POA

class RelationshipIterator;
typedef RelationshipIterator *RelationshipIterator_ptr;
typedef RelationshipIterator_ptr RelationshipIteratorRef;
typedef ObjVar<RelationshipIterator> RelationshipIterator_var;
typedef RelationshipIterator_var RelationshipIterator_out;


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

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef Role_ptr _ptr_type;
    typedef Role_var _var_type;
    #endif

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

    static Role_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 );

    struct UnknownRoleName : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      UnknownRoleName();
      ~UnknownRoleName();
      UnknownRoleName( const UnknownRoleName& s );
      UnknownRoleName& operator=( const UnknownRoleName& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      UnknownRoleName *operator->() { return this; }
      UnknownRoleName& operator*() { return *this; }
      operator UnknownRoleName*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static UnknownRoleName *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const UnknownRoleName *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef UnknownRoleName UnknownRoleName_catch;
    #else
    typedef ExceptVar<UnknownRoleName> UnknownRoleName_var;
    typedef UnknownRoleName_var UnknownRoleName_out;
    typedef UnknownRoleName_var UnknownRoleName_catch;
    #endif // HAVE_STD_EH

    struct UnknownRelationship : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      UnknownRelationship();
      ~UnknownRelationship();
      UnknownRelationship( const UnknownRelationship& s );
      UnknownRelationship& operator=( const UnknownRelationship& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      UnknownRelationship *operator->() { return this; }
      UnknownRelationship& operator*() { return *this; }
      operator UnknownRelationship*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static UnknownRelationship *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const UnknownRelationship *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef UnknownRelationship UnknownRelationship_catch;
    #else
    typedef ExceptVar<UnknownRelationship> UnknownRelationship_var;
    typedef UnknownRelationship_var UnknownRelationship_out;
    typedef UnknownRelationship_var UnknownRelationship_catch;
    #endif // HAVE_STD_EH

    struct RelationshipTypeError : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      RelationshipTypeError();
      ~RelationshipTypeError();
      RelationshipTypeError( const RelationshipTypeError& s );
      RelationshipTypeError& operator=( const RelationshipTypeError& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      RelationshipTypeError *operator->() { return this; }
      RelationshipTypeError& operator*() { return *this; }
      operator RelationshipTypeError*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static RelationshipTypeError *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const RelationshipTypeError *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef RelationshipTypeError RelationshipTypeError_catch;
    #else
    typedef ExceptVar<RelationshipTypeError> RelationshipTypeError_var;
    typedef RelationshipTypeError_var RelationshipTypeError_out;
    typedef RelationshipTypeError_var RelationshipTypeError_catch;
    #endif // HAVE_STD_EH

    struct CannotDestroyRelationship : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      CannotDestroyRelationship();
      ~CannotDestroyRelationship();
      CannotDestroyRelationship( const CannotDestroyRelationship& s );
      CannotDestroyRelationship& operator=( const CannotDestroyRelationship& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      CannotDestroyRelationship();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      CannotDestroyRelationship( const RelationshipHandles& _m0 );

      #ifdef HAVE_STD_EH
      CannotDestroyRelationship *operator->() { return this; }
      CannotDestroyRelationship& operator*() { return *this; }
      operator CannotDestroyRelationship*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static CannotDestroyRelationship *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const CannotDestroyRelationship *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      RelationshipHandles offenders;
    };

    #ifdef HAVE_STD_EH
    typedef CannotDestroyRelationship CannotDestroyRelationship_catch;
    #else
    typedef ExceptVar<CannotDestroyRelationship> CannotDestroyRelationship_var;
    typedef CannotDestroyRelationship_var CannotDestroyRelationship_out;
    typedef CannotDestroyRelationship_var CannotDestroyRelationship_catch;
    #endif // HAVE_STD_EH

    struct ParticipatingInRelationship : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      ParticipatingInRelationship();
      ~ParticipatingInRelationship();
      ParticipatingInRelationship( const ParticipatingInRelationship& s );
      ParticipatingInRelationship& operator=( const ParticipatingInRelationship& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      ParticipatingInRelationship();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      ParticipatingInRelationship( const RelationshipHandles& _m0 );

      #ifdef HAVE_STD_EH
      ParticipatingInRelationship *operator->() { return this; }
      ParticipatingInRelationship& operator*() { return *this; }
      operator ParticipatingInRelationship*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static ParticipatingInRelationship *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const ParticipatingInRelationship *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      RelationshipHandles the_relationships;
    };

    #ifdef HAVE_STD_EH
    typedef ParticipatingInRelationship ParticipatingInRelationship_catch;
    #else
    typedef ExceptVar<ParticipatingInRelationship> ParticipatingInRelationship_var;
    typedef ParticipatingInRelationship_var ParticipatingInRelationship_out;
    typedef ParticipatingInRelationship_var ParticipatingInRelationship_catch;
    #endif // HAVE_STD_EH

    virtual RelatedObject_ptr related_object() = 0;

    virtual RelatedObject_ptr get_other_related_object( const RelationshipHandle& rel, const char* target_name ) = 0;
    virtual Role_ptr get_other_role( const RelationshipHandle& rel, const char* target_name ) = 0;
    virtual void get_relationships( CORBA::ULong how_many, RelationshipHandles*& rels, RelationshipIterator_ptr& iter ) = 0;
    virtual void destroy_relationships() = 0;
    virtual void destroy() = 0;
    virtual CORBA::Boolean check_minimum_cardinality() = 0;
    virtual void link( const RelationshipHandle& rel, const NamedRoles& named_roles ) = 0;
    virtual void unlink( const RelationshipHandle& rel ) = 0;

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

// Stub for interface Role
class Role_stub:
  virtual public Role
{
  public:
    virtual ~Role_stub();
    RelatedObject_ptr related_object();

    RelatedObject_ptr get_other_related_object( const RelationshipHandle& rel, const char* target_name );
    Role_ptr get_other_role( const RelationshipHandle& rel, const char* target_name );
    void get_relationships( CORBA::ULong how_many, RelationshipHandles*& rels, RelationshipIterator_ptr& iter );
    void destroy_relationships();
    void destroy();
    CORBA::Boolean check_minimum_cardinality();
    void link( const RelationshipHandle& rel, const NamedRoles& named_roles );
    void unlink( const RelationshipHandle& rel );

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

#ifndef MICO_CONF_NO_POA

class Role_stub_clp :
  virtual public Role_stub,
  virtual public PortableServer::StubBase
{
  public:
    Role_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~Role_stub_clp ();
    RelatedObject_ptr related_object();

    RelatedObject_ptr get_other_related_object( const RelationshipHandle& rel, const char* target_name );
    Role_ptr get_other_role( const RelationshipHandle& rel, const char* target_name );
    void get_relationships( CORBA::ULong how_many, RelationshipHandles*& rels, RelationshipIterator_ptr& iter );
    void destroy_relationships();
    void destroy();
    CORBA::Boolean check_minimum_cardinality();
    void link( const RelationshipHandle& rel, const NamedRoles& named_roles );
    void unlink( const RelationshipHandle& rel );

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

#endif // MICO_CONF_NO_POA

class RoleFactory;
typedef RoleFactory *RoleFactory_ptr;
typedef RoleFactory_ptr RoleFactoryRef;
typedef ObjVar<RoleFactory> RoleFactory_var;
typedef RoleFactory_var RoleFactory_out;


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

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef RoleFactory_ptr _ptr_type;
    typedef RoleFactory_var _var_type;
    #endif

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

    static RoleFactory_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 );

    struct NilRelatedObject : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      NilRelatedObject();
      ~NilRelatedObject();
      NilRelatedObject( const NilRelatedObject& s );
      NilRelatedObject& operator=( const NilRelatedObject& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      NilRelatedObject *operator->() { return this; }
      NilRelatedObject& operator*() { return *this; }
      operator NilRelatedObject*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static NilRelatedObject *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const NilRelatedObject *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef NilRelatedObject NilRelatedObject_catch;
    #else
    typedef ExceptVar<NilRelatedObject> NilRelatedObject_var;
    typedef NilRelatedObject_var NilRelatedObject_out;
    typedef NilRelatedObject_var NilRelatedObject_catch;
    #endif // HAVE_STD_EH

    struct RelatedObjectTypeError : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      RelatedObjectTypeError();
      ~RelatedObjectTypeError();
      RelatedObjectTypeError( const RelatedObjectTypeError& s );
      RelatedObjectTypeError& operator=( const RelatedObjectTypeError& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      RelatedObjectTypeError *operator->() { return this; }
      RelatedObjectTypeError& operator*() { return *this; }
      operator RelatedObjectTypeError*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static RelatedObjectTypeError *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const RelatedObjectTypeError *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef RelatedObjectTypeError RelatedObjectTypeError_catch;
    #else
    typedef ExceptVar<RelatedObjectTypeError> RelatedObjectTypeError_var;
    typedef RelatedObjectTypeError_var RelatedObjectTypeError_out;
    typedef RelatedObjectTypeError_var RelatedObjectTypeError_catch;
    #endif // HAVE_STD_EH

    virtual CORBA::InterfaceDef_ptr role_type() = 0;
    virtual CORBA::ULong max_cardinality() = 0;
    virtual CORBA::ULong min_cardinality() = 0;
    virtual InterfaceDefs* related_object_types() = 0;

    virtual Role_ptr create_role( RelatedObject_ptr related_object ) = 0;

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

// Stub for interface RoleFactory
class RoleFactory_stub:
  virtual public RoleFactory
{
  public:
    virtual ~RoleFactory_stub();
    CORBA::InterfaceDef_ptr role_type();
    CORBA::ULong max_cardinality();
    CORBA::ULong min_cardinality();
    InterfaceDefs* related_object_types();

    Role_ptr create_role( RelatedObject_ptr related_object );

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

#ifndef MICO_CONF_NO_POA

class RoleFactory_stub_clp :
  virtual public RoleFactory_stub,
  virtual public PortableServer::StubBase
{
  public:
    RoleFactory_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~RoleFactory_stub_clp ();
    CORBA::InterfaceDef_ptr role_type();
    CORBA::ULong max_cardinality();
    CORBA::ULong min_cardinality();
    InterfaceDefs* related_object_types();

    Role_ptr create_role( RelatedObject_ptr related_object );

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

#endif // MICO_CONF_NO_POA


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

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef RelationshipIterator_ptr _ptr_type;
    typedef RelationshipIterator_var _var_type;
    #endif

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

    static RelationshipIterator_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 CORBA::Boolean next_one( RelationshipHandle*& rel ) = 0;
    virtual CORBA::Boolean next_n( CORBA::ULong how_many, RelationshipHandles*& rels ) = 0;
    virtual void destroy() = 0;

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

// Stub for interface RelationshipIterator
class RelationshipIterator_stub:
  virtual public RelationshipIterator
{
  public:
    virtual ~RelationshipIterator_stub();
    CORBA::Boolean next_one( RelationshipHandle*& rel );
    CORBA::Boolean next_n( CORBA::ULong how_many, RelationshipHandles*& rels );
    void destroy();

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

#ifndef MICO_CONF_NO_POA

class RelationshipIterator_stub_clp :
  virtual public RelationshipIterator_stub,
  virtual public PortableServer::StubBase
{
  public:
    RelationshipIterator_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~RelationshipIterator_stub_clp ();
    CORBA::Boolean next_one( RelationshipHandle*& rel );
    CORBA::Boolean next_n( CORBA::ULong how_many, RelationshipHandles*& rels );
    void destroy();

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

#endif // MICO_CONF_NO_POA

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

#ifndef MICO_NO_TOPLEVEL_MODULES

};
#endif



#ifndef MICO_CONF_NO_POA

#ifndef MICO_NO_TOPLEVEL_MODULES
MICO_NAMESPACE_DECL POA_CosRelationships {
#endif

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


class RelationshipFactory : virtual public PortableServer::StaticImplementation
{
  public:
    virtual ~RelationshipFactory ();
    CosRelationships::RelationshipFactory_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 RelationshipFactory * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual CORBA::InterfaceDef_ptr relationship_type() = 0;
    virtual CORBA::UShort degree() = 0;
    virtual CosRelationships::RelationshipFactory::NamedRoleTypes* named_role_types() = 0;

    virtual CosRelationships::Relationship_ptr create( const CosRelationships::NamedRoles& named_roles ) = 0;

  protected:
    RelationshipFactory () {};

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

#ifdef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CORBA::InterfaceDef_ptr relationship_type();
    CORBA::UShort degree();
    CosRelationships::RelationshipFactory::NamedRoleTypes* named_role_types();

    CosRelationships::Relationship_ptr create( const CosRelationships::NamedRoles& named_roles );

  protected:
    RelationshipFactory_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
RelationshipFactory_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>
CORBA::InterfaceDef_ptr
RelationshipFactory_tie<T>::relationship_type ()
{
  return POA_Tie_Base<T>::ptr->relationship_type ();
}

template<class T>
CORBA::UShort
RelationshipFactory_tie<T>::degree ()
{
  return POA_Tie_Base<T>::ptr->degree ();
}

template<class T>
CosRelationships::RelationshipFactory::NamedRoleTypes*
RelationshipFactory_tie<T>::named_role_types ()
{
  return POA_Tie_Base<T>::ptr->named_role_types ();
}

template<class T>
CosRelationships::Relationship_ptr
RelationshipFactory_tie<T>::create (const CosRelationships::NamedRoles& named_roles)
{
  return POA_Tie_Base<T>::ptr->create (named_roles);
}

#endif

class Relationship : 
  virtual public POA_CosObjectIdentity::IdentifiableObject
{
  public:
    virtual ~Relationship ();
    CosRelationships::Relationship_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 Relationship * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual CosRelationships::NamedRoles* named_roles() = 0;

    virtual void destroy() = 0;

  protected:
    Relationship () {};

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

#ifdef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CosRelationships::NamedRoles* named_roles();

    void destroy();

  protected:
    Relationship_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
Relationship_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>
CosRelationships::NamedRoles*
Relationship_tie<T>::named_roles ()
{
  return POA_Tie_Base<T>::ptr->named_roles ();
}

template<class T>
void
Relationship_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

#endif

class Role : virtual public PortableServer::StaticImplementation
{
  public:
    virtual ~Role ();
    CosRelationships::Role_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 Role * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual CosRelationships::RelatedObject_ptr related_object() = 0;

    virtual CosRelationships::RelatedObject_ptr get_other_related_object( const CosRelationships::RelationshipHandle& rel, const char* target_name ) = 0;
    virtual CosRelationships::Role_ptr get_other_role( const CosRelationships::RelationshipHandle& rel, const char* target_name ) = 0;
    virtual void get_relationships( CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels, CosRelationships::RelationshipIterator_ptr& iter ) = 0;
    virtual void destroy_relationships() = 0;
    virtual void destroy() = 0;
    virtual CORBA::Boolean check_minimum_cardinality() = 0;
    virtual void link( const CosRelationships::RelationshipHandle& rel, const CosRelationships::NamedRoles& named_roles ) = 0;
    virtual void unlink( const CosRelationships::RelationshipHandle& rel ) = 0;

  protected:
    Role () {};

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

#ifdef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CosRelationships::RelatedObject_ptr related_object();

    CosRelationships::RelatedObject_ptr get_other_related_object( const CosRelationships::RelationshipHandle& rel, const char* target_name );
    CosRelationships::Role_ptr get_other_role( const CosRelationships::RelationshipHandle& rel, const char* target_name );
    void get_relationships( CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels, CosRelationships::RelationshipIterator_ptr& iter );
    void destroy_relationships();
    void destroy();
    CORBA::Boolean check_minimum_cardinality();
    void link( const CosRelationships::RelationshipHandle& rel, const CosRelationships::NamedRoles& named_roles );
    void unlink( const CosRelationships::RelationshipHandle& rel );

  protected:
    Role_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
Role_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>
CosRelationships::RelatedObject_ptr
Role_tie<T>::related_object ()
{
  return POA_Tie_Base<T>::ptr->related_object ();
}

template<class T>
CosRelationships::RelatedObject_ptr
Role_tie<T>::get_other_related_object (const CosRelationships::RelationshipHandle& rel, const char* target_name)
{
  return POA_Tie_Base<T>::ptr->get_other_related_object (rel, target_name);
}

template<class T>
CosRelationships::Role_ptr
Role_tie<T>::get_other_role (const CosRelationships::RelationshipHandle& rel, const char* target_name)
{
  return POA_Tie_Base<T>::ptr->get_other_role (rel, target_name);
}

template<class T>
void
Role_tie<T>::get_relationships (CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels, CosRelationships::RelationshipIterator_ptr& iter)
{
  POA_Tie_Base<T>::ptr->get_relationships (how_many, rels, iter);
}

template<class T>
void
Role_tie<T>::destroy_relationships ()
{
  POA_Tie_Base<T>::ptr->destroy_relationships ();
}

template<class T>
void
Role_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

template<class T>
CORBA::Boolean
Role_tie<T>::check_minimum_cardinality ()
{
  return POA_Tie_Base<T>::ptr->check_minimum_cardinality ();
}

template<class T>
void
Role_tie<T>::link (const CosRelationships::RelationshipHandle& rel, const CosRelationships::NamedRoles& named_roles)
{
  POA_Tie_Base<T>::ptr->link (rel, named_roles);
}

template<class T>
void
Role_tie<T>::unlink (const CosRelationships::RelationshipHandle& rel)
{
  POA_Tie_Base<T>::ptr->unlink (rel);
}

#endif

class RoleFactory : virtual public PortableServer::StaticImplementation
{
  public:
    virtual ~RoleFactory ();
    CosRelationships::RoleFactory_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 RoleFactory * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual CORBA::InterfaceDef_ptr role_type() = 0;
    virtual CORBA::ULong max_cardinality() = 0;
    virtual CORBA::ULong min_cardinality() = 0;
    virtual CosRelationships::InterfaceDefs* related_object_types() = 0;

    virtual CosRelationships::Role_ptr create_role( CosRelationships::RelatedObject_ptr related_object ) = 0;

  protected:
    RoleFactory () {};

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

#ifdef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CORBA::InterfaceDef_ptr role_type();
    CORBA::ULong max_cardinality();
    CORBA::ULong min_cardinality();
    CosRelationships::InterfaceDefs* related_object_types();

    CosRelationships::Role_ptr create_role( CosRelationships::RelatedObject_ptr related_object );

  protected:
    RoleFactory_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
RoleFactory_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>
CORBA::InterfaceDef_ptr
RoleFactory_tie<T>::role_type ()
{
  return POA_Tie_Base<T>::ptr->role_type ();
}

template<class T>
CORBA::ULong
RoleFactory_tie<T>::max_cardinality ()
{
  return POA_Tie_Base<T>::ptr->max_cardinality ();
}

template<class T>
CORBA::ULong
RoleFactory_tie<T>::min_cardinality ()
{
  return POA_Tie_Base<T>::ptr->min_cardinality ();
}

template<class T>
CosRelationships::InterfaceDefs*
RoleFactory_tie<T>::related_object_types ()
{
  return POA_Tie_Base<T>::ptr->related_object_types ();
}

template<class T>
CosRelationships::Role_ptr
RoleFactory_tie<T>::create_role (CosRelationships::RelatedObject_ptr related_object)
{
  return POA_Tie_Base<T>::ptr->create_role (related_object);
}

#endif

class RelationshipIterator : virtual public PortableServer::StaticImplementation
{
  public:
    virtual ~RelationshipIterator ();
    CosRelationships::RelationshipIterator_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 RelationshipIterator * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual CORBA::Boolean next_one( CosRelationships::RelationshipHandle*& rel ) = 0;
    virtual CORBA::Boolean next_n( CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels ) = 0;
    virtual void destroy() = 0;

  protected:
    RelationshipIterator () {};

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

#ifdef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CORBA::Boolean next_one( CosRelationships::RelationshipHandle*& rel );
    CORBA::Boolean next_n( CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels );
    void destroy();

  protected:
    RelationshipIterator_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
RelationshipIterator_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>
CORBA::Boolean
RelationshipIterator_tie<T>::next_one (CosRelationships::RelationshipHandle*& rel)
{
  return POA_Tie_Base<T>::ptr->next_one (rel);
}

template<class T>
CORBA::Boolean
RelationshipIterator_tie<T>::next_n (CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels)
{
  return POA_Tie_Base<T>::ptr->next_n (how_many, rels);
}

template<class T>
void
RelationshipIterator_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

#endif

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

#ifndef MICO_NO_TOPLEVEL_MODULES

};
#endif



#ifndef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CORBA::InterfaceDef_ptr relationship_type();
    CORBA::UShort degree();
    CosRelationships::RelationshipFactory::NamedRoleTypes* named_role_types();

    CosRelationships::Relationship_ptr create( const CosRelationships::NamedRoles& named_roles );

  protected:
    POA_CosRelationships_RelationshipFactory_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
POA_CosRelationships_RelationshipFactory_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>
CORBA::InterfaceDef_ptr
POA_CosRelationships_RelationshipFactory_tie<T>::relationship_type ()
{
  return POA_Tie_Base<T>::ptr->relationship_type ();
}

template<class T>
CORBA::UShort
POA_CosRelationships_RelationshipFactory_tie<T>::degree ()
{
  return POA_Tie_Base<T>::ptr->degree ();
}

template<class T>
CosRelationships::RelationshipFactory::NamedRoleTypes*
POA_CosRelationships_RelationshipFactory_tie<T>::named_role_types ()
{
  return POA_Tie_Base<T>::ptr->named_role_types ();
}

template<class T>
CosRelationships::Relationship_ptr
POA_CosRelationships_RelationshipFactory_tie<T>::create (const CosRelationships::NamedRoles& named_roles)
{
  return POA_Tie_Base<T>::ptr->create (named_roles);
}

#endif

#ifndef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CosRelationships::NamedRoles* named_roles();

    void destroy();

  protected:
    POA_CosRelationships_Relationship_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
POA_CosRelationships_Relationship_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>
CosRelationships::NamedRoles*
POA_CosRelationships_Relationship_tie<T>::named_roles ()
{
  return POA_Tie_Base<T>::ptr->named_roles ();
}

template<class T>
void
POA_CosRelationships_Relationship_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

#endif

#ifndef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CosRelationships::RelatedObject_ptr related_object();

    CosRelationships::RelatedObject_ptr get_other_related_object( const CosRelationships::RelationshipHandle& rel, const char* target_name );
    CosRelationships::Role_ptr get_other_role( const CosRelationships::RelationshipHandle& rel, const char* target_name );
    void get_relationships( CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels, CosRelationships::RelationshipIterator_ptr& iter );
    void destroy_relationships();
    void destroy();
    CORBA::Boolean check_minimum_cardinality();
    void link( const CosRelationships::RelationshipHandle& rel, const CosRelationships::NamedRoles& named_roles );
    void unlink( const CosRelationships::RelationshipHandle& rel );

  protected:
    POA_CosRelationships_Role_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
POA_CosRelationships_Role_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>
CosRelationships::RelatedObject_ptr
POA_CosRelationships_Role_tie<T>::related_object ()
{
  return POA_Tie_Base<T>::ptr->related_object ();
}

template<class T>
CosRelationships::RelatedObject_ptr
POA_CosRelationships_Role_tie<T>::get_other_related_object (const CosRelationships::RelationshipHandle& rel, const char* target_name)
{
  return POA_Tie_Base<T>::ptr->get_other_related_object (rel, target_name);
}

template<class T>
CosRelationships::Role_ptr
POA_CosRelationships_Role_tie<T>::get_other_role (const CosRelationships::RelationshipHandle& rel, const char* target_name)
{
  return POA_Tie_Base<T>::ptr->get_other_role (rel, target_name);
}

template<class T>
void
POA_CosRelationships_Role_tie<T>::get_relationships (CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels, CosRelationships::RelationshipIterator_ptr& iter)
{
  POA_Tie_Base<T>::ptr->get_relationships (how_many, rels, iter);
}

template<class T>
void
POA_CosRelationships_Role_tie<T>::destroy_relationships ()
{
  POA_Tie_Base<T>::ptr->destroy_relationships ();
}

template<class T>
void
POA_CosRelationships_Role_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

template<class T>
CORBA::Boolean
POA_CosRelationships_Role_tie<T>::check_minimum_cardinality ()
{
  return POA_Tie_Base<T>::ptr->check_minimum_cardinality ();
}

template<class T>
void
POA_CosRelationships_Role_tie<T>::link (const CosRelationships::RelationshipHandle& rel, const CosRelationships::NamedRoles& named_roles)
{
  POA_Tie_Base<T>::ptr->link (rel, named_roles);
}

template<class T>
void
POA_CosRelationships_Role_tie<T>::unlink (const CosRelationships::RelationshipHandle& rel)
{
  POA_Tie_Base<T>::ptr->unlink (rel);
}

#endif

#ifndef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CORBA::InterfaceDef_ptr role_type();
    CORBA::ULong max_cardinality();
    CORBA::ULong min_cardinality();
    CosRelationships::InterfaceDefs* related_object_types();

    CosRelationships::Role_ptr create_role( CosRelationships::RelatedObject_ptr related_object );

  protected:
    POA_CosRelationships_RoleFactory_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
POA_CosRelationships_RoleFactory_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>
CORBA::InterfaceDef_ptr
POA_CosRelationships_RoleFactory_tie<T>::role_type ()
{
  return POA_Tie_Base<T>::ptr->role_type ();
}

template<class T>
CORBA::ULong
POA_CosRelationships_RoleFactory_tie<T>::max_cardinality ()
{
  return POA_Tie_Base<T>::ptr->max_cardinality ();
}

template<class T>
CORBA::ULong
POA_CosRelationships_RoleFactory_tie<T>::min_cardinality ()
{
  return POA_Tie_Base<T>::ptr->min_cardinality ();
}

template<class T>
CosRelationships::InterfaceDefs*
POA_CosRelationships_RoleFactory_tie<T>::related_object_types ()
{
  return POA_Tie_Base<T>::ptr->related_object_types ();
}

template<class T>
CosRelationships::Role_ptr
POA_CosRelationships_RoleFactory_tie<T>::create_role (CosRelationships::RelatedObject_ptr related_object)
{
  return POA_Tie_Base<T>::ptr->create_role (related_object);
}

#endif

#ifndef HAVE_NAMESPACE

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

    PortableServer::POA_ptr _default_POA ();

    CORBA::Boolean next_one( CosRelationships::RelationshipHandle*& rel );
    CORBA::Boolean next_n( CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels );
    void destroy();

  protected:
    POA_CosRelationships_RelationshipIterator_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
POA_CosRelationships_RelationshipIterator_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>
CORBA::Boolean
POA_CosRelationships_RelationshipIterator_tie<T>::next_one (CosRelationships::RelationshipHandle*& rel)
{
  return POA_Tie_Base<T>::ptr->next_one (rel);
}

template<class T>
CORBA::Boolean
POA_CosRelationships_RelationshipIterator_tie<T>::next_n (CORBA::ULong how_many, CosRelationships::RelationshipHandles*& rels)
{
  return POA_Tie_Base<T>::ptr->next_n (how_many, rels);
}

template<class T>
void
POA_CosRelationships_RelationshipIterator_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

#endif

#endif // MICO_CONF_NO_POA

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

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_NamedRole;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipHandle;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipFactory_NamedRoleType;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipFactory_RoleTypeError;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipFactory_MaxCardinalityExceeded;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipFactory_DegreeError;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipFactory_DuplicateRoleName;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipFactory_UnknownRoleName;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipFactory;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_Relationship_CannotUnlink;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_Relationship;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_Role_UnknownRoleName;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_Role_UnknownRelationship;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_Role_RelationshipTypeError;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_Role_CannotDestroyRelationship;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_Role_ParticipatingInRelationship;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_Role;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RoleFactory_NilRelatedObject;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RoleFactory_RelatedObjectTypeError;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RoleFactory;

extern CORBA::StaticTypeInfo *_marshaller_CosRelationships_RelationshipIterator;

extern CORBA::StaticTypeInfo *_marshaller__seq_CosRelationships_Role;

extern CORBA::StaticTypeInfo *_marshaller__seq_CosRelationships_NamedRole;

extern CORBA::StaticTypeInfo *_marshaller__seq_CosRelationships_RelationshipHandle;

extern CORBA::StaticTypeInfo *_marshaller__seq_CosRelationships_RelationshipFactory_NamedRoleType;

#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
