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

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

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

class Random;
typedef Random *Random_ptr;
typedef Random_ptr RandomRef;
typedef ObjVar<Random> Random_var;
typedef Random_var Random_out;


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

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef Random_ptr _ptr_type;
    typedef Random_var _var_type;
    #endif

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

    static Random_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::Long lrand48() = 0;
    virtual CORBA::Long mrand48() = 0;

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

// Stub for interface Random
class Random_stub:
  virtual public Random
{
  public:
    virtual ~Random_stub();
    CORBA::Long lrand48();
    CORBA::Long mrand48();

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

#ifndef MICO_CONF_NO_POA

class Random_stub_clp :
  virtual public Random_stub,
  virtual public PortableServer::StubBase
{
  public:
    Random_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~Random_stub_clp ();
    CORBA::Long lrand48();
    CORBA::Long mrand48();

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

#endif // MICO_CONF_NO_POA

#ifndef MICO_CONF_NO_POA

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

    virtual CORBA::Long lrand48() = 0;
    virtual CORBA::Long mrand48() = 0;

  protected:
    POA_Random () {};

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

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

    PortableServer::POA_ptr _default_POA ();

    CORBA::Long lrand48();
    CORBA::Long mrand48();

  protected:
    POA_Random_tie () {};

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

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

template<class T>
PortableServer::POA_ptr
POA_Random_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::Long
POA_Random_tie<T>::lrand48 ()
{
  return POA_Tie_Base<T>::ptr->lrand48 ();
}

template<class T>
CORBA::Long
POA_Random_tie<T>::mrand48 ()
{
  return POA_Tie_Base<T>::ptr->mrand48 ();
}

#endif // MICO_CONF_NO_POA

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

extern CORBA::StaticTypeInfo *_marshaller_Random;

#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
