//
//  @(#) 2.44 src/somd/orb.idl, somd, som3.0 9/26/96 14:02:08 [12/22/96 21:11:47]
//
//
//   COMPONENT_NAME: somd
//
//   ORIGINS: 27
//
//
//    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1996,1996 
//   All Rights Reserved
//   Licensed Materials - Property of IBM
//   US Government Users Restricted Rights - Use, duplication or
//   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//

//#  ORB is a PUBLIC class derived from SOMObject.
//
//  The ORB class implements the CORBA ORB object.  The ORB class defines
//  operations for:
//    - converting between object references and strings
//    - creating NVLists and determining the default context (support for DII)
//    - obtaining initial references to basic object services


#ifndef orb_idl
#define orb_idl

#include <somobj.idl>
#include <somdtype.idl>
#include <snglicls.idl>
#include <unotypes.idl>


interface OperationDef;
interface SOMDObject;
interface NVList;
interface Context;

interface ORB : SOMObject
{
  string object_to_string(in SOMObject obj);

  // Converts an object reference to its external form.  The external
  // form of an object reference is defined by CORBA 2.0.  One
  // exception is the external form of a local object in a client-only
  // process, which will have a different form.
  // OWNERSHIP of allocated memory is transferred to the caller.

  SOMObject string_to_object(in string str);

  // Converts externalized form back to an object reference.  If the
  // input string represents a local object in a client-only process,
  // and the object is no longer valid, another instance of the class
  // will be created.
  // OWNERSHIP of allocated memory is transferred to the caller.

  ORBStatus create_list(in long count, out NVList new_list);

  // Creates an NVList of the specified size.
  // OWNERSHIP of allocated "new_list" is transferred to the caller.

  ORBStatus create_operation_list(in OperationDef oper, out NVList new_list);

  // Creates a NamedValue list for the specified operation,
  // for use in Requests invoking that operation.
  // OWNERSHIP of allocated "new_list" is transferred to the caller.

  ORBStatus get_default_context(out Context ctx);

  // Returns the default process Context object.
  // OWNERSHIP of allocated Context object is transferred to the caller.

  typedef string ObjectId;
  typedef sequence <ObjectId> ObjectIdList;
  exception InvalidName{};

  ObjectIdList list_initial_services ();

  // Lists which objects have references available by calling
  // resolve_initial_references.  This list is returned as a sequence
  // of well-known strings.  Each well-known string specifies a basic
  // object service and is referred to as an ObjectId.
  // OWNERSHIP of returned strings is transferred to the caller.

  SOMObject resolve_initial_references (in ObjectId identifier)
    raises (InvalidName);

  // Takes a single ObjectId and returns an appropriate object reference
  // for the requested object service.  Since resolve_initial_references
  // returns different types of objects, it is prototyped to simply return
  // a SOMObject.  The caller may need to cast the return value to the
  // actual object class.


  attribute boolean stringToObject30;
  // If TRUE, indicates string_to_object should return SOMObject.
  // If FALSE, a SOMDObject will be returned (as in previous releases).


#ifdef __SOMIDL__

  implementation
  {
    releaseorder: object_to_string, string_to_object,
                  create_list, create_operation_list, get_default_context,
                  private1, private2, private3, private4,
                  list_initial_services, resolve_initial_references,
                  _get_stringToObject30, _set_stringToObject30,
                  private5, private6, private7, private8;

    //# Class Modifiers
    callstyle = idl;
    metaclass = SOMMSingleInstance;
    dllname = "somd.dll";
    majorversion = 2;
    minorversion = 2;

    //# Method Modifiers
    somDefaultInit: override, init;
    somDestruct: override;


    //# Passthrus
    passthru C_h_after = ""
        "#ifndef SOM_IMPORTEXPORT_somd"
        "#if defined(_WIN32) && !defined(SOM_DLL_somd)"
        	"#define SOM_IMPORTEXPORT_somd SOMDLLIMPORT"
        "#else"
        	"#define SOM_IMPORTEXPORT_somd"
        "#endif"
        "#endif"
      "#ifdef SOM_STRICT_IDL"
      "SOMEXTERN SOM_IMPORTEXPORT_somd ORB   SOMDLINK SOMD_ORBObject;"
      "#else"
      "SOMEXTERN SOM_IMPORTEXPORT_somd ORB * SOMDLINK SOMD_ORBObject;"
      "#endif /* SOM_STRICT_IDL */"
      ""
      "#include <somdobj.h>"
      "";

    passthru C_xh_after = ""
      "class ORB;"
        "#ifndef SOM_IMPORTEXPORT_somd"
        "#if defined(_WIN32) && !defined(SOM_DLL_somd)"
        	"#define SOM_IMPORTEXPORT_somd SOMDLLIMPORT"
        "#else"
        	"#define SOM_IMPORTEXPORT_somd"
        "#endif"
        "#endif"
      "SOMEXTERN SOM_IMPORTEXPORT_somd ORB * SOMDLINK SOMD_ORBObject;"
      ""
      "#include <somdobj.xh>"
      "";


  };

#endif /* __SOMIDL__ */

};

#endif  /* orb_idl */
