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

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

#ifndef __RANDOMGENERATOR_H__
#define __RANDOMGENERATOR_H__



class RandomGenerator;
typedef RandomGenerator *RandomGenerator_ptr;
typedef RandomGenerator_ptr RandomGeneratorRef;
typedef ObjVar<RandomGenerator> RandomGenerator_var;
typedef ObjOut<RandomGenerator> RandomGenerator_out;


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

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

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef RandomGenerator_ptr _ptr_type;
    typedef RandomGenerator_var _var_type;
    #endif

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

    static RandomGenerator_ptr _nil()
    {
      return 0;
    }

    virtual void *_narrow_helper( const char *repoid );

    enum Mode {
      generate = 0,
      proxy
    };

    typedef Mode& Mode_out;

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


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

    #ifdef HAVE_STD_EH
    typedef NoSuchNumber NoSuchNumber_catch;
    #else
    typedef ExceptVar<NoSuchNumber> NoSuchNumber_var;
    typedef TVarOut<NoSuchNumber> NoSuchNumber_out;
    typedef NoSuchNumber_var NoSuchNumber_catch;
    #endif // HAVE_STD_EH

    virtual CORBA::Long rand() = 0;
    virtual void add_number( CORBA::Long number ) = 0;

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

// Stub for interface RandomGenerator
class RandomGenerator_stub:
  virtual public RandomGenerator
{
  public:
    virtual ~RandomGenerator_stub();
    CORBA::Long rand();
    void add_number( CORBA::Long number );

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

#ifndef MICO_CONF_NO_POA

class RandomGenerator_stub_clp :
  virtual public RandomGenerator_stub,
  virtual public PortableServer::StubBase
{
  public:
    RandomGenerator_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~RandomGenerator_stub_clp ();
    CORBA::Long rand();
    void add_number( CORBA::Long number );

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

#endif // MICO_CONF_NO_POA

#ifndef MICO_CONF_NO_POA

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

    virtual CORBA::Long rand() = 0;
    virtual void add_number( CORBA::Long number ) = 0;

  protected:
    POA_RandomGenerator () {};

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

#endif // MICO_CONF_NO_POA

extern CORBA::StaticTypeInfo *_marshaller_RandomGenerator_Mode;

extern CORBA::StaticTypeInfo *_marshaller_RandomGenerator_NoSuchNumber;

extern CORBA::StaticTypeInfo *_marshaller_RandomGenerator;

#endif
