home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / som30tk.zip / som30os2.zip / include / omgestio.idl < prev    next >
Text File  |  1996-12-24  |  5KB  |  159 lines

  1. /*
  2.  *  @(#) 1.10 src/somext/oes/omgestio.idl, somext, som3.0 6/27/96 16:36:05 [12/24/96 08:13:37]
  3.  *
  4.  *  COMPONENT_NAME: somext
  5.  *
  6.  *  ORIGINS: 27
  7.  *
  8.  *   25H7912  (C)  COPYRIGHT International Business Machines Corp. 1995,1996
  9.  *  All Rights Reserved
  10.  *  Licensed Materials - Property of IBM
  11.  *  US Government Users Restricted Rights - Use, duplication or
  12.  *  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  13.  *
  14.  *  DESCRIPTION:
  15.  *
  16.  *  This file introduces the OMG StreamIO Service Interfaces.
  17.  */
  18.  
  19. #ifndef CosStream_module
  20. #define CosStream_module
  21.  
  22. #include <omgidobj.idl>
  23.  
  24. //
  25.  
  26. module CosLifeCycle {
  27.    interface  FactoryFinder : SOMObject {
  28.     };
  29. }; // End CosLifeCycle
  30.  
  31.  
  32. module CosStream
  33. {
  34.   exception ObjectCreationError{};
  35.   exception StreamDataFormatError{};
  36.   interface Streamable;
  37.   interface StreamableFactory;
  38.  
  39. //----------------------------------------------------------------------------
  40.   interface StreamIO : SOMObject  {
  41.     // The StreamIO interface defines an abstract class without any
  42.     // implementation.  It defines only the interfaces in the OMG
  43.     // Externalization Service for the StreamIO class.
  44.  
  45.     // Public methods used by client objects to internalize and
  46.     // externalize their internal state.
  47.  
  48.     void write_string(in string item);
  49.     void write_char(in char item);
  50.     void write_octet(in octet item);
  51.     void write_unsigned_long(in unsigned long item);
  52.     void write_unsigned_short(in unsigned short item);
  53.     void write_long(in long item);
  54.     void write_short(in short item);
  55.     void write_float(in float item);
  56.     void write_double(in double item);
  57.     void write_boolean(in boolean item);
  58.     void write_object(in Streamable item);
  59.  
  60.     string read_string()                raises(StreamDataFormatError);
  61.     char read_char()                    raises(StreamDataFormatError);
  62.     octet read_octet()                  raises(StreamDataFormatError);
  63.     unsigned long read_unsigned_long()  raises(StreamDataFormatError);
  64.     unsigned short read_unsigned_short() raises(StreamDataFormatError);
  65.     long read_long()                    raises(StreamDataFormatError);
  66.     short read_short()                  raises(StreamDataFormatError);
  67.     float read_float()                  raises(StreamDataFormatError);
  68.     double read_double()                raises(StreamDataFormatError);
  69.     boolean read_boolean()              raises(StreamDataFormatError);
  70. /* D23362
  71.     Streamable read_object(in CosLifeCycle::FactoryFinder ff,
  72.                            in Streamable obj) raises(StreamDataFormatError);
  73. */
  74.     //
  75.     //  The OMG spec also has write_graph() and read_graph() but we omitted
  76.     //  them because compound externalization is not implemented.
  77.     //
  78.     implementation {
  79.       abstract;
  80.       majorversion      = 3;
  81.       minorversion      = 0;
  82.       memory_management = corba;
  83.  
  84.       somDefaultInit:   override, init;
  85.       somDestruct:      override;
  86.       releaseorder: read_short, write_short,
  87.       read_long, write_long,
  88.       read_unsigned_short, write_unsigned_short,
  89.       read_unsigned_long, write_unsigned_long,
  90.       read_float, write_float,
  91.       read_double, write_double,
  92.       read_boolean, write_boolean,
  93.       read_char, write_char,
  94.       read_octet, write_octet,
  95.       read_string, write_string,
  96.       read_object, write_object;
  97.       dllname = "somestrm.dll";
  98.       //
  99.       //  These passthru's are needed to get the CosLifeCycle::Key declarations.
  100.       //
  101.     };
  102.   };
  103.  
  104. //----------------------------------------------------------------------------
  105.   interface Streamable : CosObjectIdentity::IdentifiableObject {
  106.     void externalize_to_stream(in StreamIO stream);
  107.     // This method must be overridden.
  108.  
  109.     void internalize_from_stream(in StreamIO stream,
  110.                                  in CosLifeCycle::FactoryFinder ff);
  111.     // This method must be overridden.
  112. /* D23362
  113.     readonly attribute CosLifeCycle::Key external_form_id;
  114. */
  115.     // The write_object method puts this attribute into the stream so that
  116.     // read_object can create a new object.
  117.  
  118.     implementation {
  119.       abstract;
  120.       majorversion      = 3;
  121.       minorversion      = 0;
  122.       memory_management = corba;
  123.  
  124.  
  125.       somDefaultInit:   override, init;
  126.       somDestruct:      override;
  127.       external_form_id: noget, nodata;
  128.       releaseorder: externalize_to_stream, internalize_from_stream,
  129.                     _get_external_form_id;
  130.       override: is_identical, _get_constant_random_id;
  131.       dllname = "somestrm.dll";
  132.     };
  133.   };
  134.  
  135. //----------------------------------------------------------------------------
  136.   interface StreamableFactory : SOMObject {
  137.  
  138.     Streamable create_uninitialized();
  139.     //
  140.     //  The OMG spec has method name "create_unitialized", which we assume
  141.     //  is a typographical error.
  142.     //
  143.     implementation {
  144.       abstract;
  145.       majorversion      = 3;
  146.       minorversion      = 0;
  147.       memory_management = corba;
  148.  
  149.       somDefaultInit:   override, init;
  150.       somDestruct:      override;
  151.       releaseorder: create_uninitialized;
  152.       dllname = "somestrm.dll";
  153.     };
  154.   };
  155.  
  156. };
  157.  
  158. #endif    // CosStream_module
  159.