home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / somdobj.idl < prev    next >
Encoding:
Text File  |  1996-02-21  |  4.6 KB  |  154 lines

  1. //
  2. //   COMPONENT_NAME: somd
  3. //
  4. //   ORIGINS: 27
  5. //
  6. //
  7. //   10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
  8. //   All Rights Reserved
  9. //   Licensed Materials - Property of IBM
  10. //   US Government Users Restricted Rights - Use, duplication or
  11. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. //
  13.  
  14. //   Interface for CORBA Object Reference.
  15. //
  16. //   This is the class that implements the behavior of CORBA object references,
  17. //   e.g., get_implementation, get_interface, duplicate, release, etc.
  18. //
  19. //   In addition, there are some private methods, which are exposed only to
  20. //   the ORB classes, to implement the ORB functions related to object
  21. //   references (e.g., ORB_object_to_string).
  22. //
  23. //   In DSOM, there is also another derivation of this class:  SOMDClientProxy.
  24. //   This subclass inherits the implementation of this class, but extends it
  25. //   by overriding somDispatch with a "remote dispatch" method, and caches the
  26. //   binding to the server process.  Whenever a remote object is accessed, it
  27. //   is represented in the client process by a SOMDClientProxy object.
  28. //
  29. //
  30.  
  31.  
  32. #ifndef somdobj_idl
  33. #define somdobj_idl
  34.  
  35. #include <somobj.idl>
  36. #include <somdtype.idl>
  37.  
  38. interface ImplementationDef;
  39. interface InterfaceDef;
  40. interface NVList;
  41. interface Context;
  42. interface Request;
  43.  
  44. interface SOMDObject : SOMObject
  45. {
  46.  
  47.   ImplementationDef get_implementation();
  48.  
  49.   // Returns the implementation definition for the referenced object.
  50.  
  51.   InterfaceDef get_interface();
  52.  
  53.   // Returns the interface definition for the referenced object.
  54.  
  55.  
  56.   boolean is_nil();
  57.  
  58.   // Tests to see if the object reference is nil.
  59.   // This is a procedure method.  Therefore, it can be invoked on OBJECT_NIL
  60.   // (a null pointer), but it cannot be overridden.
  61.  
  62.   boolean is_SOM_ref();
  63.  
  64.   // Returns TRUE if object reference was created by SOMOA::create_SOM_ref
  65.   // else returns FALSE.
  66.  
  67.   boolean is_constant();
  68.  
  69.   // Returns TRUE if object reference was created by SOMOA::create_constant
  70.   // else returns FALSE.
  71.  
  72.   boolean is_proxy();
  73.  
  74.   // Returns TRUE if object reference (self) is a DSOM client proxy object 
  75.   // (i.e., the target object is remote).  Returns FALSE if the referenced 
  76.   // object is in the same process as the reference.
  77.   //
  78.   // The default implementation returns FALSE.  Proxy classes which are
  79.   // subclasses of SOMDObject (like SOMDClientProxy) should override this 
  80.   // method to return TRUE.
  81.  
  82.   SOMDObject duplicate();
  83.  
  84.   // Makes a duplicate of the object reference.
  85.   // OWNERSHIP of returned object is transferred to the caller.
  86.   // Call release to free the object.
  87.  
  88.   void release();
  89.  
  90.   // Releases the memory associated with the object reference.
  91.  
  92.   ORBStatus create_request(in Context ctx, in Identifier operation, 
  93.                in NVList arg_list, inout NamedValue result, 
  94.                out Request request,
  95.                            in Flags req_flags);
  96.  
  97.   // Creates a request to execute a particular operation on the
  98.   // referenced object.
  99.   //
  100.   // CORBA 1.1 introduces this method in this class, but DSOM actually
  101.   // implements this method in the SOMDClientProxy subclass.
  102.  
  103.   ORBStatus create_request_args(in Identifier operation, out NVList arg_list,
  104.                                 out NamedValue result);
  105.  
  106.   // Creates the appropriate arg_list (NVList) for the specified operation.
  107.   // Also creates a NamedValue to hold the result.
  108.   // (Similar in function to ORB_create_operation_list.)
  109.   //
  110.   // This method is defined in this class, as a companion to the 
  111.   // "create_request" method, but DSOM implements this method in the 
  112.   // SOMDClientProxy subclass.
  113.  
  114.  
  115. #ifdef __SOMIDL__
  116.  
  117.   implementation
  118.   {
  119.     releaseorder: get_implementation, get_interface,
  120.           set_to_nil, is_nil,
  121.                   is_SOM_ref, is_constant, is_proxy,
  122.                   duplicate, release,
  123.           create_request, create_request_args, 
  124.           _get_somd_tag, _get_somd_flags, _set_somd_flags, 
  125.           _get_somd_impl, _set_somd_impl, _get_somd_rid, 
  126.           _set_somd_rid, _get_somd_id, _set_somd_id;
  127.  
  128.     callstyle = idl;
  129.     dllname = "somd.dll";
  130.     majorversion = 2;
  131.     minorversion = 1;
  132.  
  133.     somDefaultInit: override;
  134.     somDestruct: override;
  135.     somDumpSelfInt: override;
  136.     is_nil : procedure;
  137.  
  138.     passthru C_h_before = ""
  139.       "#include <somdtype.h>"
  140.       "";
  141.     passthru C_xh_before =  ""
  142.       "#include <somdtype.xh>"
  143.       "";
  144.     passthru C_hh_before =  ""
  145.       "#include <somdtype.hh>"
  146.       "";
  147.  
  148.   };
  149. #endif /* __SOMIDL__ */
  150.  
  151. };
  152.  
  153. #endif  /* somdobj_idl */
  154.