/*
 *  MICO --- an Open Source CORBA implementation
 *  Copyright (c) 1997-2003 by The Mico Team
 *
 *  This file was automatically generated. DO NOT EDIT!
 */

#include <CORBA.h>
#include <mico/throw.h>

#ifndef __STREAM_H__
#define __STREAM_H__






namespace MICOStream
{

class Transport;
typedef Transport *Transport_ptr;
typedef Transport_ptr TransportRef;
typedef ObjVar< Transport > Transport_var;
typedef ObjOut< Transport > Transport_out;

class ActiveCEP;
typedef ActiveCEP *ActiveCEP_ptr;
typedef ActiveCEP_ptr ActiveCEPRef;
typedef ObjVar< ActiveCEP > ActiveCEP_var;
typedef ObjOut< ActiveCEP > ActiveCEP_out;

class PassiveCEP;
typedef PassiveCEP *PassiveCEP_ptr;
typedef PassiveCEP_ptr PassiveCEPRef;
typedef ObjVar< PassiveCEP > PassiveCEP_var;
typedef ObjOut< PassiveCEP > PassiveCEP_out;

}






namespace MICOStream
{

typedef SequenceTmpl< CORBA::Octet,MICO_TID_OCTET> StreamData;
typedef TSeqVar< SequenceTmpl< CORBA::Octet,MICO_TID_OCTET> > StreamData_var;
typedef TSeqOut< SequenceTmpl< CORBA::Octet,MICO_TID_OCTET> > StreamData_out;

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


  #ifdef HAVE_STD_EH
  NotBound *operator->() { return this; }
  NotBound& operator*() { return *this; }
  operator NotBound*() { 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 NotBound *_downcast( CORBA::Exception *ex );
  static const NotBound *_downcast( const CORBA::Exception *ex );
};

#ifdef HAVE_STD_EH
typedef NotBound NotBound_catch;
#else
typedef ExceptVar< NotBound > NotBound_var;
typedef TVarOut< NotBound > NotBound_out;
typedef NotBound_var NotBound_catch;
#endif // HAVE_STD_EH

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


  #ifdef HAVE_STD_EH
  NotConnected *operator->() { return this; }
  NotConnected& operator*() { return *this; }
  operator NotConnected*() { 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 NotConnected *_downcast( CORBA::Exception *ex );
  static const NotConnected *_downcast( const CORBA::Exception *ex );
};

#ifdef HAVE_STD_EH
typedef NotConnected NotConnected_catch;
#else
typedef ExceptVar< NotConnected > NotConnected_var;
typedef TVarOut< NotConnected > NotConnected_out;
typedef NotConnected_var NotConnected_catch;
#endif // HAVE_STD_EH


/*
 * Base class and common definitions for interface Transport
 */

class Transport : 
  virtual public CORBA::Object
{
  public:
    virtual ~Transport();

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef Transport_ptr _ptr_type;
    typedef Transport_var _var_type;
    #endif

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

    static Transport_ptr _nil()
    {
      return 0;
    }

    virtual void *_narrow_helper( const char *repoid );

    virtual StreamData* poll() = 0;
    virtual StreamData* read() = 0;
    virtual void receive( const StreamData& chunk ) = 0;
    virtual void write( const StreamData& chunk ) = 0;
    virtual void write_async( const StreamData& chunk ) = 0;

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

// Stub for interface Transport
class Transport_stub:
  virtual public Transport
{
  public:
    virtual ~Transport_stub();
    StreamData* poll();
    StreamData* read();
    void receive( const StreamData& chunk );
    void write( const StreamData& chunk );
    void write_async( const StreamData& chunk );

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

class Transport_skel :
  virtual public StaticMethodDispatcher,
  virtual public Transport
{
  public:
    Transport_skel( const CORBA::BOA::ReferenceData & = CORBA::BOA::ReferenceData() );
    virtual ~Transport_skel();
    Transport_skel( CORBA::Object_ptr obj );
    virtual bool dispatch( CORBA::StaticServerRequest_ptr __req, CORBA::Environment &_env );
    Transport_ptr _this();

};


/*
 * Base class and common definitions for interface ActiveCEP
 */

class ActiveCEP : 
  virtual public ::MICOStream::Transport
{
  public:
    virtual ~ActiveCEP();

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef ActiveCEP_ptr _ptr_type;
    typedef ActiveCEP_var _var_type;
    #endif

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

    static ActiveCEP_ptr _nil()
    {
      return 0;
    }

    virtual void *_narrow_helper( const char *repoid );

    virtual void connect( const char* bind_addr ) = 0;
    virtual void disconnect() = 0;

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

// Stub for interface ActiveCEP
class ActiveCEP_stub:
  virtual public ActiveCEP,
  virtual public ::MICOStream::Transport_stub
{
  public:
    virtual ~ActiveCEP_stub();
    void connect( const char* bind_addr );
    void disconnect();

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

class ActiveCEP_skel :
  virtual public StaticMethodDispatcher,
  virtual public ActiveCEP
{
  public:
    ActiveCEP_skel( const CORBA::BOA::ReferenceData & = CORBA::BOA::ReferenceData() );
    virtual ~ActiveCEP_skel();
    ActiveCEP_skel( CORBA::Object_ptr obj );
    virtual bool dispatch( CORBA::StaticServerRequest_ptr __req, CORBA::Environment &_env );
    ActiveCEP_ptr _this();

};


/*
 * Base class and common definitions for interface PassiveCEP
 */

class PassiveCEP : 
  virtual public ::MICOStream::Transport
{
  public:
    virtual ~PassiveCEP();

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef PassiveCEP_ptr _ptr_type;
    typedef PassiveCEP_var _var_type;
    #endif

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

    static PassiveCEP_ptr _nil()
    {
      return 0;
    }

    virtual void *_narrow_helper( const char *repoid );

    virtual char* bind_addr() = 0;
    virtual void bind( const char* bind_addr ) = 0;
    virtual void disconnect() = 0;

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

// Stub for interface PassiveCEP
class PassiveCEP_stub:
  virtual public PassiveCEP,
  virtual public ::MICOStream::Transport_stub
{
  public:
    virtual ~PassiveCEP_stub();
    char* bind_addr();
    void bind( const char* bind_addr );
    void disconnect();

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

class PassiveCEP_skel :
  virtual public StaticMethodDispatcher,
  virtual public PassiveCEP
{
  public:
    PassiveCEP_skel( const CORBA::BOA::ReferenceData & = CORBA::BOA::ReferenceData() );
    virtual ~PassiveCEP_skel();
    PassiveCEP_skel( CORBA::Object_ptr obj );
    virtual bool dispatch( CORBA::StaticServerRequest_ptr __req, CORBA::Environment &_env );
    PassiveCEP_ptr _this();

};

}


#ifndef MICO_CONF_NO_POA

#endif // MICO_CONF_NO_POA

extern CORBA::StaticTypeInfo *_marshaller_MICOStream_NotBound;

extern CORBA::StaticTypeInfo *_marshaller_MICOStream_NotConnected;

extern CORBA::StaticTypeInfo *_marshaller_MICOStream_Transport;

extern CORBA::StaticTypeInfo *_marshaller_MICOStream_ActiveCEP;

extern CORBA::StaticTypeInfo *_marshaller_MICOStream_PassiveCEP;

#endif
