
/*
 * This file was generated by the SOM Compiler.
 * FileName: somestio.xh.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.19
 *     SOM Emitter emitxh.dll: 2.108
 */

#ifndef SOM_Module_somestio_somStream_defined
#define SOM_Module_somestio_somStream_defined 1
#include <som.xh>

/*
 * Start of bindings for IDL types
 */

class SOMClass;
class SOMObject;
class Container;
class ExtendedNaming_PropertyBindingIterator;
class ExtendedNaming_PropertyIterator;
class ExtendedNaming_IndexIterator;
class SOMDObject;
class Principal;
class ImplementationDef;
class InterfaceDef;
class NVList;
class Context;
class Request;
class CosObjectIdentity_IdentifiableObject;
class CosStream_Streamable;
class CosStream_StreamableFactory;
#ifndef _IDL_SEQUENCE_octet_defined
#define _IDL_SEQUENCE_octet_defined
typedef struct {
    unsigned long _maximum;
    unsigned long _length;
    octet *_buffer;
} _IDL_SEQUENCE_octet;
#endif /* _IDL_SEQUENCE_octet_defined */ 
#ifndef _IDL_SEQUENCE_octet_defined
#define _IDL_SEQUENCE_octet_defined
typedef struct {
    unsigned long _maximum;
    unsigned long _length;
    octet *_buffer;
} _IDL_SEQUENCE_octet;
#endif /* _IDL_SEQUENCE_octet_defined */ 
typedef
_IDL_SEQUENCE_octet somStream_seq_octet;
/*
 *  This sequence type is used whenever a block of bytes needs to be passed as
 *  a parameter or returned.
 */

#define somStream_GENERAL 54000 /* 54000+0 */
/*
 *  This is used when the exception id (name) is sufficiently descriptive.
 */

#define somStream_SEMAPHORE_CREATE 54001 /* 54000+1 */
#define somStream_SEMAPHORE_REQUEST 54002 /* 54000+2 */
#define somStream_SEMAPHORE_RELEASE 54003 /* 54000+3 */
/*
 *  an error occurred while using a semaphore.
 */

#define somStream_FACTORY_FINDER_LOAD 54004 /* 54000+4 */
/*
 *  unable to load somLifeCycle DLL
 */

#define somStream_FACTORY_FINDER_NEW 54005 /* 54000+5 */
/*
 *  unable to create a new factory finder
 */

#define somStream_FACTORY_FINDER_CLASS 54006 /* 54000+6 */
/*
 *  unable to get the class of the specified factory finder
 */

#define somStream_FACTORY_FINDER_METHOD 54007 /* 54000+7 */
/*
 *  unable to locate the 'find_factory' method in the class.
 */

#define somStream_FIND_FACTORY 54008 /* 54000+8 */
/*
 *  the find_factory method failed.
 */

#define somStream_NEW_NOT_STREAMABLE 54009 /* 54000+9 */
/*
 *  the new object does not support the CosStream::Streamable interface.
 */

#define somStream_OBJ_NOT_STREAMABLE 54010 /* 54000+10 */
/*
 *  the object does not support the CosStream::Streamable interface.
 */

#define somStream_FACTORY_FINDER 54011 /* 54000+11 */
/*
 *  the factory finder parameter is not correct.
 */

#define somStream_METHOD_IS_ABSTRACT 54012 /* 54000+12 */
/*
 *  The method is not implemented.
 */

#define somStream_OBJ_REPEAT_REF_MISMATCH 54013 /* 54000+13 */
/*
 *  The parm to internalize_existing does not match repeat ref in stream.
 */

#define somStream_UNABLE_TO_CREATE_STREAMIO 54014 /* 54000+14 */
/*
 *  The stream is unable to create a default streamio object.
 */

#define somStream_STREAM_CREATE_WITH_TYPES 54015 /* 54000+15 */
/*
 *  An error occured while creating a stream-streamio with the StreamFactory
 */

#define somStream_UNABLE_TO_CREATE_STREAM 54016 /* 54000+16 */
/*
 *  The streamio is unable to create a default stream object.
 */

#define somStream_INVALID_KEY_LENGTH 54017 /* 54000+17 */
/*
 *  The parameter to write_key or write_object_tag is not valid.
 */

#define somStream_ALREADY_STREAMED_PARMS 54018 /* 54000+18 */
/*
 *  Parameters to already_streamed are not valid.
 */

#define somStream_BAD_BUFFER_PARAMETER 54019 /* 54000+19 */
/*
 *  The parm to set_buffer has invalid length or the header is incorrect.
 */

#define somStream_ICONV_FAILURE 54020 /* 54000+20 */
/*
 *  An error occurred to convert the codepage of the stream data.
 */

#define somStream_READ_PASSED_END_OF_STREAM 54021 /* 54000+21 */
/*
 *  You attempted to read passed the end of the data in the streamio.
 */

#define somStream_REPEAT_REF_NUMBER_NOT_FOUND 54022 /* 54000+22 */
/*
 *  A repeat ref was read from the stream that has an invalid object number
 */

#define somStream_OBJ_NIL_DATA_MISMATCH 54023 /* 54000+23 */
/*
 *  A nil-data tag is found in the stream, but a non-nil object parm was passed.
 */

#define somStream_OBJ_STRINGIFIED_REF_MISMATCH 54024 /* 54000+24 */
/*
 *  A stringified ref found in the stream, but a non-nil object parm was passed.
 */

#define somStream_FOUND_UNKNOWN_TAG 54025 /* 54000+25 */
/*
 *  An unknown tag value is found in the stream.
 */

#define somStream_UNABLE_TO_READ_SHORT 54026 /* 54000+26 */
#define somStream_UNABLE_TO_READ_LONG 54027 /* 54000+27 */
#define somStream_UNABLE_TO_READ_USHORT 54028 /* 54000+28 */
#define somStream_UNABLE_TO_READ_ULONG 54029 /* 54000+29 */
#define somStream_UNABLE_TO_READ_STRING 54030 /* 54000+30 */
#define somStream_UNABLE_TO_READ_CHAR 54031 /* 54000+31 */
#define somStream_UNABLE_TO_READ_FLOAT 54032 /* 54000+32 */
#define somStream_UNABLE_TO_READ_DOUBLE 54033 /* 54000+33 */
#define somStream_UNABLE_TO_READ_OCTET 54034 /* 54000+34 */
#define somStream_UNABLE_TO_READ_BOOLEAN 54035 /* 54000+35 */
#define somStream_UNABLE_TO_READ_OBJECT 54036 /* 54000+36 */
/*
 *  The stream does not contain the correct delimiter for the specified data type.
 */

#define somStream_READ_FROM_EMPTY_STREAM 54037 /* 54000+37 */
/*
 *  You tried to read data from a streamio that is empty.
 */


#ifndef SOM_DONT_USE_SHORT_NAMES

#ifndef SOM_DONT_USE_SHORT_NAMES
#ifndef SOMTGD_seq_octet
    #ifdef seq_octet
        #undef seq_octet
        #define SOMTGD_seq_octet 1
    #else
        #define seq_octet somStream_seq_octet
    #endif /* seq_octet */
#endif /* SOMTGD_seq_octet */
#endif /* SOM_DONT_USE_SHORT_NAMES */
#ifndef SOMTGD_GENERAL
    #ifdef GENERAL
        #undef GENERAL
        #define SOMTGD_GENERAL 1
    #else
        #define GENERAL somStream_GENERAL
    #endif /* GENERAL */
#endif /* SOMTGD_GENERAL */
#ifndef SOMTGD_SEMAPHORE_CREATE
    #ifdef SEMAPHORE_CREATE
        #undef SEMAPHORE_CREATE
        #define SOMTGD_SEMAPHORE_CREATE 1
    #else
        #define SEMAPHORE_CREATE somStream_SEMAPHORE_CREATE
    #endif /* SEMAPHORE_CREATE */
#endif /* SOMTGD_SEMAPHORE_CREATE */
#ifndef SOMTGD_SEMAPHORE_REQUEST
    #ifdef SEMAPHORE_REQUEST
        #undef SEMAPHORE_REQUEST
        #define SOMTGD_SEMAPHORE_REQUEST 1
    #else
        #define SEMAPHORE_REQUEST somStream_SEMAPHORE_REQUEST
    #endif /* SEMAPHORE_REQUEST */
#endif /* SOMTGD_SEMAPHORE_REQUEST */
#ifndef SOMTGD_SEMAPHORE_RELEASE
    #ifdef SEMAPHORE_RELEASE
        #undef SEMAPHORE_RELEASE
        #define SOMTGD_SEMAPHORE_RELEASE 1
    #else
        #define SEMAPHORE_RELEASE somStream_SEMAPHORE_RELEASE
    #endif /* SEMAPHORE_RELEASE */
#endif /* SOMTGD_SEMAPHORE_RELEASE */
#ifndef SOMTGD_FACTORY_FINDER_LOAD
    #ifdef FACTORY_FINDER_LOAD
        #undef FACTORY_FINDER_LOAD
        #define SOMTGD_FACTORY_FINDER_LOAD 1
    #else
        #define FACTORY_FINDER_LOAD somStream_FACTORY_FINDER_LOAD
    #endif /* FACTORY_FINDER_LOAD */
#endif /* SOMTGD_FACTORY_FINDER_LOAD */
#ifndef SOMTGD_FACTORY_FINDER_NEW
    #ifdef FACTORY_FINDER_NEW
        #undef FACTORY_FINDER_NEW
        #define SOMTGD_FACTORY_FINDER_NEW 1
    #else
        #define FACTORY_FINDER_NEW somStream_FACTORY_FINDER_NEW
    #endif /* FACTORY_FINDER_NEW */
#endif /* SOMTGD_FACTORY_FINDER_NEW */
#ifndef SOMTGD_FACTORY_FINDER_CLASS
    #ifdef FACTORY_FINDER_CLASS
        #undef FACTORY_FINDER_CLASS
        #define SOMTGD_FACTORY_FINDER_CLASS 1
    #else
        #define FACTORY_FINDER_CLASS somStream_FACTORY_FINDER_CLASS
    #endif /* FACTORY_FINDER_CLASS */
#endif /* SOMTGD_FACTORY_FINDER_CLASS */
#ifndef SOMTGD_FACTORY_FINDER_METHOD
    #ifdef FACTORY_FINDER_METHOD
        #undef FACTORY_FINDER_METHOD
        #define SOMTGD_FACTORY_FINDER_METHOD 1
    #else
        #define FACTORY_FINDER_METHOD somStream_FACTORY_FINDER_METHOD
    #endif /* FACTORY_FINDER_METHOD */
#endif /* SOMTGD_FACTORY_FINDER_METHOD */
#ifndef SOMTGD_FIND_FACTORY
    #ifdef FIND_FACTORY
        #undef FIND_FACTORY
        #define SOMTGD_FIND_FACTORY 1
    #else
        #define FIND_FACTORY somStream_FIND_FACTORY
    #endif /* FIND_FACTORY */
#endif /* SOMTGD_FIND_FACTORY */
#ifndef SOMTGD_NEW_NOT_STREAMABLE
    #ifdef NEW_NOT_STREAMABLE
        #undef NEW_NOT_STREAMABLE
        #define SOMTGD_NEW_NOT_STREAMABLE 1
    #else
        #define NEW_NOT_STREAMABLE somStream_NEW_NOT_STREAMABLE
    #endif /* NEW_NOT_STREAMABLE */
#endif /* SOMTGD_NEW_NOT_STREAMABLE */
#ifndef SOMTGD_OBJ_NOT_STREAMABLE
    #ifdef OBJ_NOT_STREAMABLE
        #undef OBJ_NOT_STREAMABLE
        #define SOMTGD_OBJ_NOT_STREAMABLE 1
    #else
        #define OBJ_NOT_STREAMABLE somStream_OBJ_NOT_STREAMABLE
    #endif /* OBJ_NOT_STREAMABLE */
#endif /* SOMTGD_OBJ_NOT_STREAMABLE */
#ifndef SOMTGD_FACTORY_FINDER
    #ifdef FACTORY_FINDER
        #undef FACTORY_FINDER
        #define SOMTGD_FACTORY_FINDER 1
    #else
        #define FACTORY_FINDER somStream_FACTORY_FINDER
    #endif /* FACTORY_FINDER */
#endif /* SOMTGD_FACTORY_FINDER */
#ifndef SOMTGD_METHOD_IS_ABSTRACT
    #ifdef METHOD_IS_ABSTRACT
        #undef METHOD_IS_ABSTRACT
        #define SOMTGD_METHOD_IS_ABSTRACT 1
    #else
        #define METHOD_IS_ABSTRACT somStream_METHOD_IS_ABSTRACT
    #endif /* METHOD_IS_ABSTRACT */
#endif /* SOMTGD_METHOD_IS_ABSTRACT */
#ifndef SOMTGD_OBJ_REPEAT_REF_MISMATCH
    #ifdef OBJ_REPEAT_REF_MISMATCH
        #undef OBJ_REPEAT_REF_MISMATCH
        #define SOMTGD_OBJ_REPEAT_REF_MISMATCH 1
    #else
        #define OBJ_REPEAT_REF_MISMATCH somStream_OBJ_REPEAT_REF_MISMATCH
    #endif /* OBJ_REPEAT_REF_MISMATCH */
#endif /* SOMTGD_OBJ_REPEAT_REF_MISMATCH */
#ifndef SOMTGD_UNABLE_TO_CREATE_STREAMIO
    #ifdef UNABLE_TO_CREATE_STREAMIO
        #undef UNABLE_TO_CREATE_STREAMIO
        #define SOMTGD_UNABLE_TO_CREATE_STREAMIO 1
    #else
        #define UNABLE_TO_CREATE_STREAMIO somStream_UNABLE_TO_CREATE_STREAMIO
    #endif /* UNABLE_TO_CREATE_STREAMIO */
#endif /* SOMTGD_UNABLE_TO_CREATE_STREAMIO */
#ifndef SOMTGD_STREAM_CREATE_WITH_TYPES
    #ifdef STREAM_CREATE_WITH_TYPES
        #undef STREAM_CREATE_WITH_TYPES
        #define SOMTGD_STREAM_CREATE_WITH_TYPES 1
    #else
        #define STREAM_CREATE_WITH_TYPES somStream_STREAM_CREATE_WITH_TYPES
    #endif /* STREAM_CREATE_WITH_TYPES */
#endif /* SOMTGD_STREAM_CREATE_WITH_TYPES */
#ifndef SOMTGD_UNABLE_TO_CREATE_STREAM
    #ifdef UNABLE_TO_CREATE_STREAM
        #undef UNABLE_TO_CREATE_STREAM
        #define SOMTGD_UNABLE_TO_CREATE_STREAM 1
    #else
        #define UNABLE_TO_CREATE_STREAM somStream_UNABLE_TO_CREATE_STREAM
    #endif /* UNABLE_TO_CREATE_STREAM */
#endif /* SOMTGD_UNABLE_TO_CREATE_STREAM */
#ifndef SOMTGD_INVALID_KEY_LENGTH
    #ifdef INVALID_KEY_LENGTH
        #undef INVALID_KEY_LENGTH
        #define SOMTGD_INVALID_KEY_LENGTH 1
    #else
        #define INVALID_KEY_LENGTH somStream_INVALID_KEY_LENGTH
    #endif /* INVALID_KEY_LENGTH */
#endif /* SOMTGD_INVALID_KEY_LENGTH */
#ifndef SOMTGD_ALREADY_STREAMED_PARMS
    #ifdef ALREADY_STREAMED_PARMS
        #undef ALREADY_STREAMED_PARMS
        #define SOMTGD_ALREADY_STREAMED_PARMS 1
    #else
        #define ALREADY_STREAMED_PARMS somStream_ALREADY_STREAMED_PARMS
    #endif /* ALREADY_STREAMED_PARMS */
#endif /* SOMTGD_ALREADY_STREAMED_PARMS */
#ifndef SOMTGD_BAD_BUFFER_PARAMETER
    #ifdef BAD_BUFFER_PARAMETER
        #undef BAD_BUFFER_PARAMETER
        #define SOMTGD_BAD_BUFFER_PARAMETER 1
    #else
        #define BAD_BUFFER_PARAMETER somStream_BAD_BUFFER_PARAMETER
    #endif /* BAD_BUFFER_PARAMETER */
#endif /* SOMTGD_BAD_BUFFER_PARAMETER */
#ifndef SOMTGD_ICONV_FAILURE
    #ifdef ICONV_FAILURE
        #undef ICONV_FAILURE
        #define SOMTGD_ICONV_FAILURE 1
    #else
        #define ICONV_FAILURE somStream_ICONV_FAILURE
    #endif /* ICONV_FAILURE */
#endif /* SOMTGD_ICONV_FAILURE */
#ifndef SOMTGD_READ_PASSED_END_OF_STREAM
    #ifdef READ_PASSED_END_OF_STREAM
        #undef READ_PASSED_END_OF_STREAM
        #define SOMTGD_READ_PASSED_END_OF_STREAM 1
    #else
        #define READ_PASSED_END_OF_STREAM somStream_READ_PASSED_END_OF_STREAM
    #endif /* READ_PASSED_END_OF_STREAM */
#endif /* SOMTGD_READ_PASSED_END_OF_STREAM */
#ifndef SOMTGD_REPEAT_REF_NUMBER_NOT_FOUND
    #ifdef REPEAT_REF_NUMBER_NOT_FOUND
        #undef REPEAT_REF_NUMBER_NOT_FOUND
        #define SOMTGD_REPEAT_REF_NUMBER_NOT_FOUND 1
    #else
        #define REPEAT_REF_NUMBER_NOT_FOUND somStream_REPEAT_REF_NUMBER_NOT_FOUND
    #endif /* REPEAT_REF_NUMBER_NOT_FOUND */
#endif /* SOMTGD_REPEAT_REF_NUMBER_NOT_FOUND */
#ifndef SOMTGD_OBJ_NIL_DATA_MISMATCH
    #ifdef OBJ_NIL_DATA_MISMATCH
        #undef OBJ_NIL_DATA_MISMATCH
        #define SOMTGD_OBJ_NIL_DATA_MISMATCH 1
    #else
        #define OBJ_NIL_DATA_MISMATCH somStream_OBJ_NIL_DATA_MISMATCH
    #endif /* OBJ_NIL_DATA_MISMATCH */
#endif /* SOMTGD_OBJ_NIL_DATA_MISMATCH */
#ifndef SOMTGD_OBJ_STRINGIFIED_REF_MISMATCH
    #ifdef OBJ_STRINGIFIED_REF_MISMATCH
        #undef OBJ_STRINGIFIED_REF_MISMATCH
        #define SOMTGD_OBJ_STRINGIFIED_REF_MISMATCH 1
    #else
        #define OBJ_STRINGIFIED_REF_MISMATCH somStream_OBJ_STRINGIFIED_REF_MISMATCH
    #endif /* OBJ_STRINGIFIED_REF_MISMATCH */
#endif /* SOMTGD_OBJ_STRINGIFIED_REF_MISMATCH */
#ifndef SOMTGD_FOUND_UNKNOWN_TAG
    #ifdef FOUND_UNKNOWN_TAG
        #undef FOUND_UNKNOWN_TAG
        #define SOMTGD_FOUND_UNKNOWN_TAG 1
    #else
        #define FOUND_UNKNOWN_TAG somStream_FOUND_UNKNOWN_TAG
    #endif /* FOUND_UNKNOWN_TAG */
#endif /* SOMTGD_FOUND_UNKNOWN_TAG */
#ifndef SOMTGD_UNABLE_TO_READ_SHORT
    #ifdef UNABLE_TO_READ_SHORT
        #undef UNABLE_TO_READ_SHORT
        #define SOMTGD_UNABLE_TO_READ_SHORT 1
    #else
        #define UNABLE_TO_READ_SHORT somStream_UNABLE_TO_READ_SHORT
    #endif /* UNABLE_TO_READ_SHORT */
#endif /* SOMTGD_UNABLE_TO_READ_SHORT */
#ifndef SOMTGD_UNABLE_TO_READ_LONG
    #ifdef UNABLE_TO_READ_LONG
        #undef UNABLE_TO_READ_LONG
        #define SOMTGD_UNABLE_TO_READ_LONG 1
    #else
        #define UNABLE_TO_READ_LONG somStream_UNABLE_TO_READ_LONG
    #endif /* UNABLE_TO_READ_LONG */
#endif /* SOMTGD_UNABLE_TO_READ_LONG */
#ifndef SOMTGD_UNABLE_TO_READ_USHORT
    #ifdef UNABLE_TO_READ_USHORT
        #undef UNABLE_TO_READ_USHORT
        #define SOMTGD_UNABLE_TO_READ_USHORT 1
    #else
        #define UNABLE_TO_READ_USHORT somStream_UNABLE_TO_READ_USHORT
    #endif /* UNABLE_TO_READ_USHORT */
#endif /* SOMTGD_UNABLE_TO_READ_USHORT */
#ifndef SOMTGD_UNABLE_TO_READ_ULONG
    #ifdef UNABLE_TO_READ_ULONG
        #undef UNABLE_TO_READ_ULONG
        #define SOMTGD_UNABLE_TO_READ_ULONG 1
    #else
        #define UNABLE_TO_READ_ULONG somStream_UNABLE_TO_READ_ULONG
    #endif /* UNABLE_TO_READ_ULONG */
#endif /* SOMTGD_UNABLE_TO_READ_ULONG */
#ifndef SOMTGD_UNABLE_TO_READ_STRING
    #ifdef UNABLE_TO_READ_STRING
        #undef UNABLE_TO_READ_STRING
        #define SOMTGD_UNABLE_TO_READ_STRING 1
    #else
        #define UNABLE_TO_READ_STRING somStream_UNABLE_TO_READ_STRING
    #endif /* UNABLE_TO_READ_STRING */
#endif /* SOMTGD_UNABLE_TO_READ_STRING */
#ifndef SOMTGD_UNABLE_TO_READ_CHAR
    #ifdef UNABLE_TO_READ_CHAR
        #undef UNABLE_TO_READ_CHAR
        #define SOMTGD_UNABLE_TO_READ_CHAR 1
    #else
        #define UNABLE_TO_READ_CHAR somStream_UNABLE_TO_READ_CHAR
    #endif /* UNABLE_TO_READ_CHAR */
#endif /* SOMTGD_UNABLE_TO_READ_CHAR */
#ifndef SOMTGD_UNABLE_TO_READ_FLOAT
    #ifdef UNABLE_TO_READ_FLOAT
        #undef UNABLE_TO_READ_FLOAT
        #define SOMTGD_UNABLE_TO_READ_FLOAT 1
    #else
        #define UNABLE_TO_READ_FLOAT somStream_UNABLE_TO_READ_FLOAT
    #endif /* UNABLE_TO_READ_FLOAT */
#endif /* SOMTGD_UNABLE_TO_READ_FLOAT */
#ifndef SOMTGD_UNABLE_TO_READ_DOUBLE
    #ifdef UNABLE_TO_READ_DOUBLE
        #undef UNABLE_TO_READ_DOUBLE
        #define SOMTGD_UNABLE_TO_READ_DOUBLE 1
    #else
        #define UNABLE_TO_READ_DOUBLE somStream_UNABLE_TO_READ_DOUBLE
    #endif /* UNABLE_TO_READ_DOUBLE */
#endif /* SOMTGD_UNABLE_TO_READ_DOUBLE */
#ifndef SOMTGD_UNABLE_TO_READ_OCTET
    #ifdef UNABLE_TO_READ_OCTET
        #undef UNABLE_TO_READ_OCTET
        #define SOMTGD_UNABLE_TO_READ_OCTET 1
    #else
        #define UNABLE_TO_READ_OCTET somStream_UNABLE_TO_READ_OCTET
    #endif /* UNABLE_TO_READ_OCTET */
#endif /* SOMTGD_UNABLE_TO_READ_OCTET */
#ifndef SOMTGD_UNABLE_TO_READ_BOOLEAN
    #ifdef UNABLE_TO_READ_BOOLEAN
        #undef UNABLE_TO_READ_BOOLEAN
        #define SOMTGD_UNABLE_TO_READ_BOOLEAN 1
    #else
        #define UNABLE_TO_READ_BOOLEAN somStream_UNABLE_TO_READ_BOOLEAN
    #endif /* UNABLE_TO_READ_BOOLEAN */
#endif /* SOMTGD_UNABLE_TO_READ_BOOLEAN */
#ifndef SOMTGD_UNABLE_TO_READ_OBJECT
    #ifdef UNABLE_TO_READ_OBJECT
        #undef UNABLE_TO_READ_OBJECT
        #define SOMTGD_UNABLE_TO_READ_OBJECT 1
    #else
        #define UNABLE_TO_READ_OBJECT somStream_UNABLE_TO_READ_OBJECT
    #endif /* UNABLE_TO_READ_OBJECT */
#endif /* SOMTGD_UNABLE_TO_READ_OBJECT */
#ifndef SOMTGD_READ_FROM_EMPTY_STREAM
    #ifdef READ_FROM_EMPTY_STREAM
        #undef READ_FROM_EMPTY_STREAM
        #define SOMTGD_READ_FROM_EMPTY_STREAM 1
    #else
        #define READ_FROM_EMPTY_STREAM somStream_READ_FROM_EMPTY_STREAM
    #endif /* READ_FROM_EMPTY_STREAM */
#endif /* SOMTGD_READ_FROM_EMPTY_STREAM */
#endif /* SOM_DONT_USE_SHORT_NAMES */

/*
 * End of bindings for IDL types.
 */
#endif /* SOM_Module_somestio_somStream_defined */

#ifndef SOM_somStream_StreamIO_xh
#define SOM_somStream_StreamIO_xh


/*
 *  The StreamIO interface defines a semi-abstract class.
 *  No objects of this class should be created, instead
 *  use one of the stream classes derived from the StreamIO class.
 *  The StreamIO interface implements the write_object and read_object methods
 *  and delegates them to Stream methods externalize_ref and internalize
 *  respectively.
 *  All other methods from CosStream::StreamIO must be implemented by subclasses.
 *  Subclasses must also implement some methods introduced by this StreamIO
 *  as noted in the comments below.
 *  Do not override the read/write_object/_value methods here.
 *  Instead, if necessary, you should override the Stream class methods.
 * 
 */

#define somStream_StreamIO_MajorVersion 3
#define somStream_StreamIO_MinorVersion 0
class somStream_StreamIO;

/*
 *  The StreamIO interface defines a semi-abstract class.
 *  No objects of this class should be created, instead
 *  use one of the stream classes derived from the StreamIO class.
 *  The StreamIO interface implements the write_object and read_object methods
 *  and delegates them to Stream methods externalize_ref and internalize
 *  respectively.
 *  All other methods from CosStream::StreamIO must be implemented by subclasses.
 *  Subclasses must also implement some methods introduced by this StreamIO
 *  as noted in the comments below.
 *  Do not override the read/write_object/_value methods here.
 *  Instead, if necessary, you should override the Stream class methods.
 * 
 */

/* Parents */
#ifndef SOM_CosStream_StreamIO_xh
#ifdef SOMLOCALINCLUDES
#include "omgestio.xh"
#else
#include <omgestio.xh>
#endif
#endif

/* Useful C++ SOM defs */
#include <somcls.xh>
#include <somcm.xh>

#ifndef somStream_StreamIO_API
#define somStream_StreamIO_API
/*
 * -- The Class API
 */
#ifndef SOM_IMPORTEXPORT_somestrm_somestio
#ifdef SOM_DLL_somestrm
	/* export semantics */
	#if defined(SOM_DEFFILE_somestrm)\
	||(defined(SOM_DEFFILE_BY_DEFAULT)&&!defined(SOM_NODEFFILE_somestrm))\
	|| !defined(SOM_Module_somestio_Source)
	#define SOM_IMPORTEXPORT_somestrm_somestio
	#else
	#define SOM_IMPORTEXPORT_somestrm_somestio SOMDLLEXPORT
	#endif
#else
	#define SOM_IMPORTEXPORT_somestrm_somestio SOMDLLIMPORT
#endif
#endif

/*
 * Start of bindings for IDL types
 */

typedef unsigned long somStream_StreamIO_object_tags;
/*
 *  These tags have values 1..4.  Other tags are also allowed and they are
 *  defined by the Stream implementation.
 *  D23362
 *     readonly attribute SOMObject stream;
 *  If the streamio is created by the StreamFactory, then this attribute
 *  will point to the stream object that "owns" this streamio.  The calls
 *  to read/write_object are delegated to the containing stream.
 *  If the _get_stream() method is called, and the stream attribute is not
 *  set to anything (NULL), then a new somExternalization::Stream object is
 *  created and returned.  The allows the read/write_object methods to work
 *  even when the StreamIO has not been created by the StreamFactory.  The
 *  _get_stream method may be overridden to change this behavior.
 *  Note: the type of this attribute should be somExternalization::Stream,
 *  but because of circular dependencies, it isn't.
 *  D23362
 *     void write_object_tag(in octet tag, in long objnum, in CosLifeCycle::Key key);
 *  This method writes an object prefix to the StreamIO buffer.
 *  Subclasses may or may not override.
 *  The StreamIO writes key or object number for tag=1,2.
 *  If the Stream passes any other tag value, the StreamIO just writes the tag
 *  and ignores the other parameters.
 *  Tag is one of the following values
 *    1. Object is externalized with KEY and DATA. objnum is ignored.
 *    2. Repeated Reference, use objnum. key is ignored.
 *    3. NIL object. objnum and key are ignored.
 *    4. Stringified reference objnum and key are ignored.
 *  Any other value of tag: The tag is written and objnum and key are ignored.
 *  D23362
 *     octet read_object_tag(out long objnum, out CosLifeCycle::Key key);
 *  This method reads an object prefix from the StreamIO buffer.
 *  Subclasses may or may not override.
 */

#define somStream_StreamIO_KeyData 1UL
#define somStream_StreamIO_RepeatRef 2UL
#define somStream_StreamIO_NilData 3UL
#define somStream_StreamIO_StringifiedRef 4UL

#ifndef SOM_DONT_USE_SHORT_NAMES
#ifndef SOMTGD_object_tags
    #ifdef object_tags
        #undef object_tags
        #define SOMTGD_object_tags 1
    #else
        #define object_tags somStream_StreamIO_object_tags
    #endif /* object_tags */
#endif /* SOMTGD_object_tags */
#endif /* SOM_DONT_USE_SHORT_NAMES */

/*
 * End of bindings for IDL types.
 */

/*
 * A function to create the somStream_StreamIO class object...
 */
SOMEXTERN SOM_IMPORTEXPORT_somestrm_somestio SOMClass * SOMLINK somStream_StreamIONewClass(
		integer4 majorVersion,
		integer4 minorVersion);


/*
 * The API 2 ClassData Structures...
 */
SOMEXTERN struct somStream_StreamIOClassDataStructure {
	SOMClass *classObject;
	somMToken write_object_tag;
	somMToken read_object_tag;
	somMToken write_object_value;
	somMToken read_key;
	somMToken write_key;
	somMToken reset;
	somMToken get_buffer;
	somMToken set_buffer;
	somMToken clear_buffer;
	somMToken _get_stream;
	somMToken already_streamed;
	somMToken private1;
} SOMDLINK SOM_IMPORTEXPORT_somestrm_somestio somStream_StreamIOClassData;
SOMEXTERN struct somStream_StreamIOCClassDataStructure {
	som3ClassDetailsPtr    parentMtab;
	somDToken              instanceDataToken;
} SOMDLINK SOM_IMPORTEXPORT_somestrm_somestio somStream_StreamIOCClassData;


/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_somStream_StreamIO (somStream_StreamIOClassData.classObject)
#ifndef SOMGD_somStream_StreamIO
    #if (defined(_somStream_StreamIO) || defined(__somStream_StreamIO))
        #undef _somStream_StreamIO
        #undef __somStream_StreamIO
        #define SOMGD_somStream_StreamIO 1
    #else
        #define _somStream_StreamIO _SOMCLASS_somStream_StreamIO
    #endif /* _somStream_StreamIO */
#endif /* SOMGD_somStream_StreamIO */
#define somStream_StreamIO_classObj _SOMCLASS_somStream_StreamIO
#define _SOMMTOKEN_somStream_StreamIO(method) ((somMToken)somStream_StreamIOClassData.method)

/*
 * -- Typedefs for somStream_StreamIO Method Procedures
 */
SOMEXTERN {
typedef boolean   SOMLINK somTP_somStream_StreamIO_already_streamed(somStream_StreamIO *somSelf, Environment *ev, 
		SOMObject* obj, 
		SOMObject* class_obj);
typedef somTP_somStream_StreamIO_already_streamed *somTD_somStream_StreamIO_already_streamed;
typedef void   SOMLINK somTP_somStream_StreamIO_reset(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_reset *somTD_somStream_StreamIO_reset;
typedef void   SOMLINK somTP_somStream_StreamIO_set_buffer(somStream_StreamIO *somSelf, Environment *ev, 
		somStream_seq_octet* buffer);
typedef somTP_somStream_StreamIO_set_buffer *somTD_somStream_StreamIO_set_buffer;
typedef somStream_seq_octet   SOMLINK somTP_somStream_StreamIO_get_buffer(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_get_buffer *somTD_somStream_StreamIO_get_buffer;
typedef void   SOMLINK somTP_somStream_StreamIO_clear_buffer(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_clear_buffer *somTD_somStream_StreamIO_clear_buffer;

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef void   SOMLINK somTP_somStream_StreamIO_write_string(somStream_StreamIO *somSelf, Environment *ev, 
		string item);
typedef somTP_somStream_StreamIO_write_string *somTD_somStream_StreamIO_write_string;
typedef void   SOMLINK somTP_somStream_StreamIO_write_char(somStream_StreamIO *somSelf, Environment *ev, 
		char item);
typedef somTP_somStream_StreamIO_write_char *somTD_somStream_StreamIO_write_char;
typedef void   SOMLINK somTP_somStream_StreamIO_write_octet(somStream_StreamIO *somSelf, Environment *ev, 
		octet item);
typedef somTP_somStream_StreamIO_write_octet *somTD_somStream_StreamIO_write_octet;
typedef void   SOMLINK somTP_somStream_StreamIO_write_unsigned_long(somStream_StreamIO *somSelf, Environment *ev, 
		unsigned long item);
typedef somTP_somStream_StreamIO_write_unsigned_long *somTD_somStream_StreamIO_write_unsigned_long;
typedef void   SOMLINK somTP_somStream_StreamIO_write_unsigned_short(somStream_StreamIO *somSelf, Environment *ev, 
		unsigned short item);
typedef somTP_somStream_StreamIO_write_unsigned_short *somTD_somStream_StreamIO_write_unsigned_short;
typedef void   SOMLINK somTP_somStream_StreamIO_write_long(somStream_StreamIO *somSelf, Environment *ev, 
		long item);
typedef somTP_somStream_StreamIO_write_long *somTD_somStream_StreamIO_write_long;
typedef void   SOMLINK somTP_somStream_StreamIO_write_short(somStream_StreamIO *somSelf, Environment *ev, 
		short item);
typedef somTP_somStream_StreamIO_write_short *somTD_somStream_StreamIO_write_short;
typedef void   SOMLINK somTP_somStream_StreamIO_write_float(somStream_StreamIO *somSelf, Environment *ev, 
		float item);
typedef somTP_somStream_StreamIO_write_float *somTD_somStream_StreamIO_write_float;
typedef void   SOMLINK somTP_somStream_StreamIO_write_double(somStream_StreamIO *somSelf, Environment *ev, 
		double item);
typedef somTP_somStream_StreamIO_write_double *somTD_somStream_StreamIO_write_double;
typedef void   SOMLINK somTP_somStream_StreamIO_write_boolean(somStream_StreamIO *somSelf, Environment *ev, 
		boolean item);
typedef somTP_somStream_StreamIO_write_boolean *somTD_somStream_StreamIO_write_boolean;
typedef void   SOMLINK somTP_somStream_StreamIO_write_object(somStream_StreamIO *somSelf, Environment *ev, 
		CosStream_Streamable* item);
typedef somTP_somStream_StreamIO_write_object *somTD_somStream_StreamIO_write_object;
typedef string   SOMLINK somTP_somStream_StreamIO_read_string(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_string *somTD_somStream_StreamIO_read_string;
typedef char   SOMLINK somTP_somStream_StreamIO_read_char(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_char *somTD_somStream_StreamIO_read_char;
typedef octet   SOMLINK somTP_somStream_StreamIO_read_octet(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_octet *somTD_somStream_StreamIO_read_octet;
typedef unsigned long   SOMLINK somTP_somStream_StreamIO_read_unsigned_long(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_unsigned_long *somTD_somStream_StreamIO_read_unsigned_long;
typedef unsigned short   SOMLINK somTP_somStream_StreamIO_read_unsigned_short(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_unsigned_short *somTD_somStream_StreamIO_read_unsigned_short;
typedef long   SOMLINK somTP_somStream_StreamIO_read_long(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_long *somTD_somStream_StreamIO_read_long;
typedef short   SOMLINK somTP_somStream_StreamIO_read_short(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_short *somTD_somStream_StreamIO_read_short;
typedef float   SOMLINK somTP_somStream_StreamIO_read_float(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_float *somTD_somStream_StreamIO_read_float;
typedef double   SOMLINK somTP_somStream_StreamIO_read_double(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_double *somTD_somStream_StreamIO_read_double;
typedef boolean   SOMLINK somTP_somStream_StreamIO_read_boolean(somStream_StreamIO *somSelf, Environment *ev);
typedef somTP_somStream_StreamIO_read_boolean *somTD_somStream_StreamIO_read_boolean;
typedef void   SOMLINK somTP_somStream_StreamIO_somDefaultInit(somStream_StreamIO *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_somStream_StreamIO_somDefaultInit *somTD_somStream_StreamIO_somDefaultInit;
typedef void   SOMLINK somTP_somStream_StreamIO_somDestruct(somStream_StreamIO *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_somStream_StreamIO_somDestruct *somTD_somStream_StreamIO_somDestruct;
typedef void   SOMLINK somTP_somStream_StreamIO_somDefaultCopyInit(somStream_StreamIO *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_StreamIO_somDefaultCopyInit *somTD_somStream_StreamIO_somDefaultCopyInit;
typedef somStream_StreamIO*   SOMLINK somTP_somStream_StreamIO_somDefaultAssign(somStream_StreamIO *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_StreamIO_somDefaultAssign *somTD_somStream_StreamIO_somDefaultAssign;
typedef void   SOMLINK somTP_somStream_StreamIO_somDefaultConstCopyInit(somStream_StreamIO *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_StreamIO_somDefaultConstCopyInit *somTD_somStream_StreamIO_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_somStream_StreamIO_somDefaultVCopyInit(somStream_StreamIO *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_StreamIO_somDefaultVCopyInit *somTD_somStream_StreamIO_somDefaultVCopyInit;
typedef void   SOMLINK somTP_somStream_StreamIO_somDefaultConstVCopyInit(somStream_StreamIO *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_StreamIO_somDefaultConstVCopyInit *somTD_somStream_StreamIO_somDefaultConstVCopyInit;
typedef somStream_StreamIO*   SOMLINK somTP_somStream_StreamIO_somDefaultConstAssign(somStream_StreamIO *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_StreamIO_somDefaultConstAssign *somTD_somStream_StreamIO_somDefaultConstAssign;
typedef somStream_StreamIO*   SOMLINK somTP_somStream_StreamIO_somDefaultVAssign(somStream_StreamIO *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_StreamIO_somDefaultVAssign *somTD_somStream_StreamIO_somDefaultVAssign;
typedef somStream_StreamIO*   SOMLINK somTP_somStream_StreamIO_somDefaultConstVAssign(somStream_StreamIO *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_StreamIO_somDefaultConstVAssign *somTD_somStream_StreamIO_somDefaultConstVAssign;
typedef void   SOMLINK somTP_somStream_StreamIO_somInit(somStream_StreamIO *somSelf);
typedef somTP_somStream_StreamIO_somInit *somTD_somStream_StreamIO_somInit;
typedef void   SOMLINK somTP_somStream_StreamIO_somUninit(somStream_StreamIO *somSelf);
typedef somTP_somStream_StreamIO_somUninit *somTD_somStream_StreamIO_somUninit;
typedef void   SOMLINK somTP_somStream_StreamIO_somFree(somStream_StreamIO *somSelf);
typedef somTP_somStream_StreamIO_somFree *somTD_somStream_StreamIO_somFree;
typedef SOMClass*   SOMLINK somTP_somStream_StreamIO_somGetClass(somStream_StreamIO *somSelf);
typedef somTP_somStream_StreamIO_somGetClass *somTD_somStream_StreamIO_somGetClass;
typedef string   SOMLINK somTP_somStream_StreamIO_somGetClassName(somStream_StreamIO *somSelf);
typedef somTP_somStream_StreamIO_somGetClassName *somTD_somStream_StreamIO_somGetClassName;
typedef long   SOMLINK somTP_somStream_StreamIO_somGetSize(somStream_StreamIO *somSelf);
typedef somTP_somStream_StreamIO_somGetSize *somTD_somStream_StreamIO_somGetSize;
typedef boolean   SOMLINK somTP_somStream_StreamIO_somIsA(somStream_StreamIO *somSelf, 
		SOMClass* aClassObj);
typedef somTP_somStream_StreamIO_somIsA *somTD_somStream_StreamIO_somIsA;
typedef boolean   SOMLINK somTP_somStream_StreamIO_somIsInstanceOf(somStream_StreamIO *somSelf, 
		SOMClass* aClassObj);
typedef somTP_somStream_StreamIO_somIsInstanceOf *somTD_somStream_StreamIO_somIsInstanceOf;
typedef boolean   SOMLINK somTP_somStream_StreamIO_somRespondsTo(somStream_StreamIO *somSelf, 
		somId mId);
typedef somTP_somStream_StreamIO_somRespondsTo *somTD_somStream_StreamIO_somRespondsTo;
typedef boolean   SOMLINK somTP_somStream_StreamIO_somDispatch(somStream_StreamIO *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_somStream_StreamIO_somDispatch *somTD_somStream_StreamIO_somDispatch;
typedef boolean   SOMLINK somTP_somStream_StreamIO_somClassDispatch(somStream_StreamIO *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_somStream_StreamIO_somClassDispatch *somTD_somStream_StreamIO_somClassDispatch;
typedef boolean   SOMLINK somTP_somStream_StreamIO_somCastObj(somStream_StreamIO *somSelf, 
		SOMClass* castedCls);
typedef somTP_somStream_StreamIO_somCastObj *somTD_somStream_StreamIO_somCastObj;
typedef boolean   SOMLINK somTP_somStream_StreamIO_somResetObj(somStream_StreamIO *somSelf);
typedef somTP_somStream_StreamIO_somResetObj *somTD_somStream_StreamIO_somResetObj;
typedef somStream_StreamIO*   SOMLINK somTP_somStream_StreamIO_somPrintSelf(somStream_StreamIO *somSelf);
typedef somTP_somStream_StreamIO_somPrintSelf *somTD_somStream_StreamIO_somPrintSelf;
typedef void   SOMLINK somTP_somStream_StreamIO_somDumpSelf(somStream_StreamIO *somSelf, 
		long level);
typedef somTP_somStream_StreamIO_somDumpSelf *somTD_somStream_StreamIO_somDumpSelf;
typedef void   SOMLINK somTP_somStream_StreamIO_somDumpSelfInt(somStream_StreamIO *somSelf, 
		long level);
typedef somTP_somStream_StreamIO_somDumpSelfInt *somTD_somStream_StreamIO_somDumpSelfInt;
}

#endif /* somStream_StreamIO_API */


/*
 * -- The C++ Wrapper Class for somStream_StreamIO
 */
class somStream_StreamIO : public CosStream_StreamIO
{
/*
 *  The StreamIO interface defines a semi-abstract class.
 *  No objects of this class should be created, instead
 *  use one of the stream classes derived from the StreamIO class.
 *  The StreamIO interface implements the write_object and read_object methods
 *  and delegates them to Stream methods externalize_ref and internalize
 *  respectively.
 *  All other methods from CosStream::StreamIO must be implemented by subclasses.
 *  Subclasses must also implement some methods introduced by this StreamIO
 *  as noted in the comments below.
 *  Do not override the read/write_object/_value methods here.
 *  Instead, if necessary, you should override the Stream class methods.
 * 
 */
public:

// somStream_StreamIO::new creates the class object if necessary, and then uses
// somNewNoInit to allocate memory and create the object.
// Initialization is in ctors.
void *operator new(size_t)
{
   if (!_somStream_StreamIO) somStream_StreamIONewClass(somStream_StreamIO_MajorVersion,somStream_StreamIO_MinorVersion);
   return (void*)
   (((somTD_SOMClass_somNewNoInit)(SOMClassClassData.somNewNoInit))
         ((SOMClass *)((void*)_somStream_StreamIO)));
}

// somStream_StreamIO::delete uses somFree.
void operator delete(void * obj)
{
   if (obj && *(void**)obj)
      ((SOMObject*)obj)->somFree();
}

somStream_StreamIO& operator=(somStream_StreamIO& fromObj)
{
   this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
   return *this;
}

somStream_StreamIO()
{
   if (*(void**)this != (somStream_StreamIOCClassData.parentMtab)->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultInit(0);
}

somStream_StreamIO(somStream_StreamIO* fromObj)
{
   if (*(void**)this != (somStream_StreamIOCClassData.parentMtab)->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
}


/* method: already_streamed */
boolean   already_streamed(Environment *ev, 
		SOMObject* obj, 
		SOMObject* class_obj)
{
/*
 *  This is called by Streamable objects to detect diamond top situations.
 *  D23362    void write_object_value(in CosStream::Streamable item);
 *  This method writes the data of an object to the StreamIO.  If you call
 *  write_object, the data may or may not be written to the StreamIO, depending
 *  on the implementation of externalize_ref that is being used.
 *  For example, if the object is has persistent references,then the Stream may
 *  just write a stringified reference.  However, write_object_value will always
 *  externalize the object data to the stream (using tag values 1, 2 or 3).
 *  The streamable object should call write_object_value only if it "owns"
 *  the object and wants to force the data to be written.
 *  Note: The default implementation of write_object simply calls write_object_value.
 *  More specialized Stream implementations may write something else, like
 *  a stringified reference.
 *  D23363
 *     void write_key(in CosLifeCycle::Key item);
 *     CosLifeCycle::Key read_key() raises(CosStream::StreamDataFormatError);
 *  The read/write key methods are used by read/write object tag methods
 *  An implementation is provided for these which uses the read/write long
 *  and string.  Subclasses may or may not override.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_StreamIO_already_streamed)(somStream_StreamIOClassData.already_streamed))(((somStream_StreamIO *)((void *)this)), ev,obj,class_obj)
	);
}


/* method: reset */
void   reset(Environment *ev)
{
/*
 *  Reset current position in stream to the first byte.
 *  Subsequent reads or writes will begin with the first byte in
 *  the stream buffer.
 *  This MUST be overridden by subclasses.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_StreamIO_reset)(somStream_StreamIOClassData.reset))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: set_buffer */
void   set_buffer(Environment *ev, 
		somStream_seq_octet* buffer)
{
/*
 *  Set buffer to copy of this buffer. Client should deallocate buffer.
 *  The current position is reset to the first byte in the buffer.
 *  This MUST be overridden by subclasses.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_StreamIO_set_buffer)(somStream_StreamIOClassData.set_buffer))(((somStream_StreamIO *)((void *)this)), ev,buffer)
	);
}


/* method: get_buffer */
somStream_seq_octet   get_buffer(Environment *ev)
{
/*
 *  Returns copy of buffer. Client is responsible for deallocating.
 *  The size of the buffer returned to the client is also returned
 *  in the length parameter.
 *  This MUST be overridden by subclasses.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_StreamIO_get_buffer)(somStream_StreamIOClassData.get_buffer))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: clear_buffer */
void   clear_buffer(Environment *ev)
{
/*
 *  Empty the buffer.  Essentially makes the StreamIO just like a new one.
 *  This MUST be overridden by subclasses.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_StreamIO_clear_buffer)(somStream_StreamIOClassData.clear_buffer))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/*
 * Reintroduce inherited methods
 */

/* method: write_string */
void   write_string(Environment *ev, 
		string item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_string)(CosStream_StreamIOClassData.write_string))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_char */
void   write_char(Environment *ev, 
		char item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_char)(CosStream_StreamIOClassData.write_char))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_octet */
void   write_octet(Environment *ev, 
		octet item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_octet)(CosStream_StreamIOClassData.write_octet))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_unsigned_long */
void   write_unsigned_long(Environment *ev, 
		unsigned long item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_unsigned_long)(CosStream_StreamIOClassData.write_unsigned_long))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_unsigned_short */
void   write_unsigned_short(Environment *ev, 
		unsigned short item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_unsigned_short)(CosStream_StreamIOClassData.write_unsigned_short))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_long */
void   write_long(Environment *ev, 
		long item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_long)(CosStream_StreamIOClassData.write_long))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_short */
void   write_short(Environment *ev, 
		short item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_short)(CosStream_StreamIOClassData.write_short))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_float */
void   write_float(Environment *ev, 
		float item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_float)(CosStream_StreamIOClassData.write_float))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_double */
void   write_double(Environment *ev, 
		double item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_double)(CosStream_StreamIOClassData.write_double))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_boolean */
void   write_boolean(Environment *ev, 
		boolean item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_boolean)(CosStream_StreamIOClassData.write_boolean))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_object */
void   write_object(Environment *ev, 
		CosStream_Streamable* item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_write_object)(CosStream_StreamIOClassData.write_object))(((somStream_StreamIO *)((void *)this)), ev,item)
	);
}


/* method: read_string */
string   read_string(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_string)(CosStream_StreamIOClassData.read_string))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_char */
char   read_char(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_char)(CosStream_StreamIOClassData.read_char))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_octet */
octet   read_octet(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_octet)(CosStream_StreamIOClassData.read_octet))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_unsigned_long */
unsigned long   read_unsigned_long(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_unsigned_long)(CosStream_StreamIOClassData.read_unsigned_long))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_unsigned_short */
unsigned short   read_unsigned_short(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_unsigned_short)(CosStream_StreamIOClassData.read_unsigned_short))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_long */
long   read_long(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_long)(CosStream_StreamIOClassData.read_long))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_short */
short   read_short(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_short)(CosStream_StreamIOClassData.read_short))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_float */
float   read_float(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_float)(CosStream_StreamIOClassData.read_float))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_double */
double   read_double(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_double)(CosStream_StreamIOClassData.read_double))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* method: read_boolean */
boolean   read_boolean(Environment *ev)
{
/*
 *  D23362
 *     Streamable read_object(in CosLifeCycle::FactoryFinder ff,
 *                            in Streamable obj) raises(StreamDataFormatError);
 * 
 *   The OMG spec also has write_graph() and read_graph() but we omitted
 *   them because compound externalization is not implemented.
 * 
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_StreamIO_read_boolean)(CosStream_StreamIOClassData.read_boolean))(((somStream_StreamIO *)((void *)this)), ev)
	);
}


/* initializer method: somDefaultInit */
void   somDefaultInit(som3InitCtrl* ctrl)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultInit)(SOMObjectClassData.somDefaultInit))(((somStream_StreamIO *)((void *)this)),ctrl)
	);
}


/* method: somDestruct */
void   somDestruct(octet doFree, 
		som3DestructCtrl* ctrl)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDestruct)(SOMObjectClassData.somDestruct))(((somStream_StreamIO *)((void *)this)),doFree,ctrl)
	);
}


/* initializer method: somDefaultCopyInit */
void   somDefaultCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor. Use this to make copies of objects for
 *  calling methods with "by-value" argument semantics.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultCopyInit)(SOMObjectClassData.somDefaultCopyInit))(((somStream_StreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultAssign */
somStream_StreamIO*  somDefaultAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator. Use this to "assign" the state of one
 *  object to another.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultAssign)(SOMObjectClassData.somDefaultAssign))(((somStream_StreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstCopyInit */
void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultConstCopyInit)(SOMObjectClassData.somDefaultConstCopyInit))(((somStream_StreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultVCopyInit */
void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultVCopyInit)(SOMObjectClassData.somDefaultVCopyInit))(((somStream_StreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstVCopyInit */
void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultConstVCopyInit)(SOMObjectClassData.somDefaultConstVCopyInit))(((somStream_StreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultConstAssign */
somStream_StreamIO*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultConstAssign)(SOMObjectClassData.somDefaultConstAssign))(((somStream_StreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultVAssign */
somStream_StreamIO*  somDefaultVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a volatile fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultVAssign)(SOMObjectClassData.somDefaultVAssign))(((somStream_StreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultConstVAssign */
somStream_StreamIO*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const volatile fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDefaultConstVAssign)(SOMObjectClassData.somDefaultConstVAssign))(((somStream_StreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somInit */
void   somInit()
{
/*
 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somInit)(SOMObjectClassData.somInit))(((somStream_StreamIO *)((void *)this)))
	);
}


/* method: somUninit */
void   somUninit()
{
/*
 *  Obsolete but still supported. Override somDestruct instead of somUninit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somUninit)(SOMObjectClassData.somUninit))(((somStream_StreamIO *)((void *)this)))
	);
}


/* method: somFree */
void   somFree()
{
/*
 *  The default implementation just calls somDestruct.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somFree)(SOMObjectClassData.somFree))(((somStream_StreamIO *)((void *)this)))
	);
}


/* method: somGetClass */
SOMClass*   somGetClass()
{
/*
 *  Return the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somGetClass)(SOMObjectClassData.somGetClass))(((somStream_StreamIO *)((void *)this)))
	);
}


/* method: somGetClassName */
string   somGetClassName()
{
/*
 *  Return the name of the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somGetClassName)(SOMObjectClassData.somGetClassName))(((somStream_StreamIO *)((void *)this)))
	);
}


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somGetSize)(SOMObjectClassData.somGetSize))(((somStream_StreamIO *)((void *)this)))
	);
}


/* method: somIsA */
boolean   somIsA(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver responds to methods
 *  introduced by <aClassObj>, and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somIsA)(SOMObjectClassData.somIsA))(((somStream_StreamIO *)((void *)this)),aClassObj)
	);
}


/* method: somIsInstanceOf */
boolean   somIsInstanceOf(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver is an instance of
 *  <aClassObj> and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somIsInstanceOf)(SOMObjectClassData.somIsInstanceOf))(((somStream_StreamIO *)((void *)this)),aClassObj)
	);
}


/* method: somRespondsTo */
boolean   somRespondsTo(somId mId)
{
/*
 *  Returns 1 (true) if the indicated method can be invoked
 *  on the receiver and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somRespondsTo)(SOMObjectClassData.somRespondsTo))(((somStream_StreamIO *)((void *)this)),mId)
	);
}


/* va_list method: somDispatch */

/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 * 
 *  Default redispatch stubs invoke this method.
 */
/* the va_list invocation form */
boolean   SOMObject_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDispatch)(SOMObjectClassData.somDispatch))(((somStream_StreamIO *)((void *)this)),retValue,methodId,ap)
	);
}

/* the varargs invocation form */
boolean   somDispatch(somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 * 
 *  Default redispatch stubs invoke this method.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDispatch)(SOMObjectClassData.somDispatch))(((somStream_StreamIO *)((void *)this)),retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* va_list method: somClassDispatch */

/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
/* the va_list invocation form */
boolean   SOMObject_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((somStream_StreamIO *)((void *)this)),clsObj,retValue,methodId,ap)
	);
}

/* the varargs invocation form */
boolean   somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((somStream_StreamIO *)((void *)this)),clsObj,retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* method: somCastObj */
boolean   somCastObj(SOMClass* castedCls)
{
/*
 *  Changes the behavior of the target object to that implemented
 *  by castedCls. This is possible when all concrete data in castedCls
 *  is also concrete in the true class of the target object.
 *  Returns true (1) on success, and false (0) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somCastObj)(SOMObjectClassData.somCastObj))(((somStream_StreamIO *)((void *)this)),castedCls)
	);
}


/* method: somResetObj */
boolean   somResetObj()
{
/*
 *  reset an object to its true class. Returns true always.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somResetObj)(SOMObjectClassData.somResetObj))(((somStream_StreamIO *)((void *)this)))
	);
}


/* method: somPrintSelf */
somStream_StreamIO*  somPrintSelf()
{
/*
 *  Uses <SOMOutCharRoutine> to write a brief string with identifying
 *  information about this object.  The default implementation just gives
 *  the object's class name and its address in memory.
 *  <self> is returned.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somPrintSelf)(SOMObjectClassData.somPrintSelf))(((somStream_StreamIO *)((void *)this)))
	);
}


/* method: somDumpSelf */
void   somDumpSelf(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write a detailed description of this object
 *  and its current state.
 * 
 *  <level> indicates the nesting level for describing compound objects
 *  it must be greater than or equal to zero.  All lines in the
 *  description will be preceeded by <2*level> spaces.
 * 
 *  This routine only actually writes the data that concerns the object
 *  as a whole, such as class, and uses <somDumpSelfInt> to describe
 *  the object's current state.  This approach allows readable
 *  descriptions of compound objects to be constructed.
 * 
 *  Generally it is not necessary to override this method, if it is
 *  overriden it generally must be completely replaced.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDumpSelf)(SOMObjectClassData.somDumpSelf))(((somStream_StreamIO *)((void *)this)),level)
	);
}


/* method: somDumpSelfInt */
void   somDumpSelfInt(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write in the current state of this object.
 *  Generally this method will need to be overridden.  When overriding
 *  it, begin by calling the parent class form of this method and then
 *  write in a description of your class's instance data. This will
 *  result in a description of all the object's instance data going
 *  from its root ancestor class to its specific class.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_StreamIO_somDumpSelfInt)(SOMObjectClassData.somDumpSelfInt))(((somStream_StreamIO *)((void *)this)),level)
	);
}



};   /* somStream_StreamIO */



#endif       /* SOM_somStream_StreamIO_xh */

#ifndef SOM_somStream_MemoryStreamIO_xh
#define SOM_somStream_MemoryStreamIO_xh


/*
 *  The MemoryStreamIO interface implements two type of byte data streams.
 *  One with "Big Endian" numeric values and the other with "Little
 *  Endian" numeric values.  The "Little Endian" memory streams are
 *  created on Intel-like machines and the "Big Endian" memory streams
 *  are created on non-Intel-like machines.  These are the native
 *  formats for these machines.  Both type of memory streams are
 *  portable to the other machine type because byte flipping is
 *  performed by the transfer_in and transfer_out methods when the
 *  memory stream type is different from the native machine type.
 * 
 */

#define somStream_MemoryStreamIO_MajorVersion 3
#define somStream_MemoryStreamIO_MinorVersion 0
class somStream_MemoryStreamIO;

/*
 *  The MemoryStreamIO interface implements two type of byte data streams.
 *  One with "Big Endian" numeric values and the other with "Little
 *  Endian" numeric values.  The "Little Endian" memory streams are
 *  created on Intel-like machines and the "Big Endian" memory streams
 *  are created on non-Intel-like machines.  These are the native
 *  formats for these machines.  Both type of memory streams are
 *  portable to the other machine type because byte flipping is
 *  performed by the transfer_in and transfer_out methods when the
 *  memory stream type is different from the native machine type.
 * 
 */

/* Parents */
#ifndef SOM_somStream_StreamIO_xh
#ifdef SOMLOCALINCLUDES
#include "somestio.xh"
#else
#include <somestio.xh>
#endif
#endif

/* Useful C++ SOM defs */
#include <somcls.xh>
#include <somcm.xh>

#ifndef somStream_MemoryStreamIO_API
#define somStream_MemoryStreamIO_API
/*
 * -- The Class API
 */

/*
 * Start of bindings for IDL types
 */


/*
 * End of bindings for IDL types.
 */

/*
 * A function to create the somStream_MemoryStreamIO class object...
 */
SOMEXTERN SOM_IMPORTEXPORT_somestrm_somestio SOMClass * SOMLINK somStream_MemoryStreamIONewClass(
		integer4 majorVersion,
		integer4 minorVersion);


/*
 * The API 2 ClassData Structures...
 */
SOMEXTERN struct somStream_MemoryStreamIOClassDataStructure {
	SOMClass *classObject;
} SOMDLINK SOM_IMPORTEXPORT_somestrm_somestio somStream_MemoryStreamIOClassData;
SOMEXTERN struct somStream_MemoryStreamIOCClassDataStructure {
	som3ClassDetailsPtr    parentMtab;
	somDToken              instanceDataToken;
} SOMDLINK SOM_IMPORTEXPORT_somestrm_somestio somStream_MemoryStreamIOCClassData;


/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_somStream_MemoryStreamIO (somStream_MemoryStreamIOClassData.classObject)
#ifndef SOMGD_somStream_MemoryStreamIO
    #if (defined(_somStream_MemoryStreamIO) || defined(__somStream_MemoryStreamIO))
        #undef _somStream_MemoryStreamIO
        #undef __somStream_MemoryStreamIO
        #define SOMGD_somStream_MemoryStreamIO 1
    #else
        #define _somStream_MemoryStreamIO _SOMCLASS_somStream_MemoryStreamIO
    #endif /* _somStream_MemoryStreamIO */
#endif /* SOMGD_somStream_MemoryStreamIO */
#define somStream_MemoryStreamIO_classObj _SOMCLASS_somStream_MemoryStreamIO
#define _SOMMTOKEN_somStream_MemoryStreamIO(method) ((somMToken)somStream_MemoryStreamIOClassData.method)

/*
 * -- Typedefs for somStream_MemoryStreamIO Method Procedures
 */
SOMEXTERN {

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_already_streamed(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		SOMObject* obj, 
		SOMObject* class_obj);
typedef somTP_somStream_MemoryStreamIO_already_streamed *somTD_somStream_MemoryStreamIO_already_streamed;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_reset(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_reset *somTD_somStream_MemoryStreamIO_reset;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_set_buffer(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		somStream_seq_octet* buffer);
typedef somTP_somStream_MemoryStreamIO_set_buffer *somTD_somStream_MemoryStreamIO_set_buffer;
typedef somStream_seq_octet   SOMLINK somTP_somStream_MemoryStreamIO_get_buffer(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_get_buffer *somTD_somStream_MemoryStreamIO_get_buffer;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_clear_buffer(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_clear_buffer *somTD_somStream_MemoryStreamIO_clear_buffer;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultInit(somStream_MemoryStreamIO *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_somStream_MemoryStreamIO_somDefaultInit *somTD_somStream_MemoryStreamIO_somDefaultInit;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somDestruct(somStream_MemoryStreamIO *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_somStream_MemoryStreamIO_somDestruct *somTD_somStream_MemoryStreamIO_somDestruct;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_string(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		string item);
typedef somTP_somStream_MemoryStreamIO_write_string *somTD_somStream_MemoryStreamIO_write_string;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_char(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		char item);
typedef somTP_somStream_MemoryStreamIO_write_char *somTD_somStream_MemoryStreamIO_write_char;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_octet(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		octet item);
typedef somTP_somStream_MemoryStreamIO_write_octet *somTD_somStream_MemoryStreamIO_write_octet;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_unsigned_long(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		unsigned long item);
typedef somTP_somStream_MemoryStreamIO_write_unsigned_long *somTD_somStream_MemoryStreamIO_write_unsigned_long;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_unsigned_short(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		unsigned short item);
typedef somTP_somStream_MemoryStreamIO_write_unsigned_short *somTD_somStream_MemoryStreamIO_write_unsigned_short;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_long(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		long item);
typedef somTP_somStream_MemoryStreamIO_write_long *somTD_somStream_MemoryStreamIO_write_long;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_short(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		short item);
typedef somTP_somStream_MemoryStreamIO_write_short *somTD_somStream_MemoryStreamIO_write_short;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_float(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		float item);
typedef somTP_somStream_MemoryStreamIO_write_float *somTD_somStream_MemoryStreamIO_write_float;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_double(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		double item);
typedef somTP_somStream_MemoryStreamIO_write_double *somTD_somStream_MemoryStreamIO_write_double;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_boolean(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		boolean item);
typedef somTP_somStream_MemoryStreamIO_write_boolean *somTD_somStream_MemoryStreamIO_write_boolean;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_write_object(somStream_MemoryStreamIO *somSelf, Environment *ev, 
		CosStream_Streamable* item);
typedef somTP_somStream_MemoryStreamIO_write_object *somTD_somStream_MemoryStreamIO_write_object;
typedef string   SOMLINK somTP_somStream_MemoryStreamIO_read_string(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_string *somTD_somStream_MemoryStreamIO_read_string;
typedef char   SOMLINK somTP_somStream_MemoryStreamIO_read_char(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_char *somTD_somStream_MemoryStreamIO_read_char;
typedef octet   SOMLINK somTP_somStream_MemoryStreamIO_read_octet(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_octet *somTD_somStream_MemoryStreamIO_read_octet;
typedef unsigned long   SOMLINK somTP_somStream_MemoryStreamIO_read_unsigned_long(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_unsigned_long *somTD_somStream_MemoryStreamIO_read_unsigned_long;
typedef unsigned short   SOMLINK somTP_somStream_MemoryStreamIO_read_unsigned_short(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_unsigned_short *somTD_somStream_MemoryStreamIO_read_unsigned_short;
typedef long   SOMLINK somTP_somStream_MemoryStreamIO_read_long(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_long *somTD_somStream_MemoryStreamIO_read_long;
typedef short   SOMLINK somTP_somStream_MemoryStreamIO_read_short(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_short *somTD_somStream_MemoryStreamIO_read_short;
typedef float   SOMLINK somTP_somStream_MemoryStreamIO_read_float(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_float *somTD_somStream_MemoryStreamIO_read_float;
typedef double   SOMLINK somTP_somStream_MemoryStreamIO_read_double(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_double *somTD_somStream_MemoryStreamIO_read_double;
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_read_boolean(somStream_MemoryStreamIO *somSelf, Environment *ev);
typedef somTP_somStream_MemoryStreamIO_read_boolean *somTD_somStream_MemoryStreamIO_read_boolean;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultCopyInit(somStream_MemoryStreamIO *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_MemoryStreamIO_somDefaultCopyInit *somTD_somStream_MemoryStreamIO_somDefaultCopyInit;
typedef somStream_MemoryStreamIO*   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultAssign(somStream_MemoryStreamIO *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_MemoryStreamIO_somDefaultAssign *somTD_somStream_MemoryStreamIO_somDefaultAssign;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultConstCopyInit(somStream_MemoryStreamIO *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_MemoryStreamIO_somDefaultConstCopyInit *somTD_somStream_MemoryStreamIO_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultVCopyInit(somStream_MemoryStreamIO *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_MemoryStreamIO_somDefaultVCopyInit *somTD_somStream_MemoryStreamIO_somDefaultVCopyInit;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultConstVCopyInit(somStream_MemoryStreamIO *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_MemoryStreamIO_somDefaultConstVCopyInit *somTD_somStream_MemoryStreamIO_somDefaultConstVCopyInit;
typedef somStream_MemoryStreamIO*   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultConstAssign(somStream_MemoryStreamIO *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_MemoryStreamIO_somDefaultConstAssign *somTD_somStream_MemoryStreamIO_somDefaultConstAssign;
typedef somStream_MemoryStreamIO*   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultVAssign(somStream_MemoryStreamIO *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_MemoryStreamIO_somDefaultVAssign *somTD_somStream_MemoryStreamIO_somDefaultVAssign;
typedef somStream_MemoryStreamIO*   SOMLINK somTP_somStream_MemoryStreamIO_somDefaultConstVAssign(somStream_MemoryStreamIO *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_MemoryStreamIO_somDefaultConstVAssign *somTD_somStream_MemoryStreamIO_somDefaultConstVAssign;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somInit(somStream_MemoryStreamIO *somSelf);
typedef somTP_somStream_MemoryStreamIO_somInit *somTD_somStream_MemoryStreamIO_somInit;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somUninit(somStream_MemoryStreamIO *somSelf);
typedef somTP_somStream_MemoryStreamIO_somUninit *somTD_somStream_MemoryStreamIO_somUninit;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somFree(somStream_MemoryStreamIO *somSelf);
typedef somTP_somStream_MemoryStreamIO_somFree *somTD_somStream_MemoryStreamIO_somFree;
typedef SOMClass*   SOMLINK somTP_somStream_MemoryStreamIO_somGetClass(somStream_MemoryStreamIO *somSelf);
typedef somTP_somStream_MemoryStreamIO_somGetClass *somTD_somStream_MemoryStreamIO_somGetClass;
typedef string   SOMLINK somTP_somStream_MemoryStreamIO_somGetClassName(somStream_MemoryStreamIO *somSelf);
typedef somTP_somStream_MemoryStreamIO_somGetClassName *somTD_somStream_MemoryStreamIO_somGetClassName;
typedef long   SOMLINK somTP_somStream_MemoryStreamIO_somGetSize(somStream_MemoryStreamIO *somSelf);
typedef somTP_somStream_MemoryStreamIO_somGetSize *somTD_somStream_MemoryStreamIO_somGetSize;
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_somIsA(somStream_MemoryStreamIO *somSelf, 
		SOMClass* aClassObj);
typedef somTP_somStream_MemoryStreamIO_somIsA *somTD_somStream_MemoryStreamIO_somIsA;
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_somIsInstanceOf(somStream_MemoryStreamIO *somSelf, 
		SOMClass* aClassObj);
typedef somTP_somStream_MemoryStreamIO_somIsInstanceOf *somTD_somStream_MemoryStreamIO_somIsInstanceOf;
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_somRespondsTo(somStream_MemoryStreamIO *somSelf, 
		somId mId);
typedef somTP_somStream_MemoryStreamIO_somRespondsTo *somTD_somStream_MemoryStreamIO_somRespondsTo;
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_somDispatch(somStream_MemoryStreamIO *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_somStream_MemoryStreamIO_somDispatch *somTD_somStream_MemoryStreamIO_somDispatch;
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_somClassDispatch(somStream_MemoryStreamIO *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_somStream_MemoryStreamIO_somClassDispatch *somTD_somStream_MemoryStreamIO_somClassDispatch;
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_somCastObj(somStream_MemoryStreamIO *somSelf, 
		SOMClass* castedCls);
typedef somTP_somStream_MemoryStreamIO_somCastObj *somTD_somStream_MemoryStreamIO_somCastObj;
typedef boolean   SOMLINK somTP_somStream_MemoryStreamIO_somResetObj(somStream_MemoryStreamIO *somSelf);
typedef somTP_somStream_MemoryStreamIO_somResetObj *somTD_somStream_MemoryStreamIO_somResetObj;
typedef somStream_MemoryStreamIO*   SOMLINK somTP_somStream_MemoryStreamIO_somPrintSelf(somStream_MemoryStreamIO *somSelf);
typedef somTP_somStream_MemoryStreamIO_somPrintSelf *somTD_somStream_MemoryStreamIO_somPrintSelf;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somDumpSelf(somStream_MemoryStreamIO *somSelf, 
		long level);
typedef somTP_somStream_MemoryStreamIO_somDumpSelf *somTD_somStream_MemoryStreamIO_somDumpSelf;
typedef void   SOMLINK somTP_somStream_MemoryStreamIO_somDumpSelfInt(somStream_MemoryStreamIO *somSelf, 
		long level);
typedef somTP_somStream_MemoryStreamIO_somDumpSelfInt *somTD_somStream_MemoryStreamIO_somDumpSelfInt;
}

#endif /* somStream_MemoryStreamIO_API */


/*
 * -- The C++ Wrapper Class for somStream_MemoryStreamIO
 */
class somStream_MemoryStreamIO : public somStream_StreamIO
{
/*
 *  The MemoryStreamIO interface implements two type of byte data streams.
 *  One with "Big Endian" numeric values and the other with "Little
 *  Endian" numeric values.  The "Little Endian" memory streams are
 *  created on Intel-like machines and the "Big Endian" memory streams
 *  are created on non-Intel-like machines.  These are the native
 *  formats for these machines.  Both type of memory streams are
 *  portable to the other machine type because byte flipping is
 *  performed by the transfer_in and transfer_out methods when the
 *  memory stream type is different from the native machine type.
 * 
 */
public:

// somStream_MemoryStreamIO::new creates the class object if necessary, and then uses
// somNewNoInit to allocate memory and create the object.
// Initialization is in ctors.
void *operator new(size_t)
{
   if (!_somStream_MemoryStreamIO) somStream_MemoryStreamIONewClass(somStream_MemoryStreamIO_MajorVersion,somStream_MemoryStreamIO_MinorVersion);
   return (void*)
   (((somTD_SOMClass_somNewNoInit)(SOMClassClassData.somNewNoInit))
         ((SOMClass *)((void*)_somStream_MemoryStreamIO)));
}

// somStream_MemoryStreamIO::delete uses somFree.
void operator delete(void * obj)
{
   if (obj && *(void**)obj)
      ((SOMObject*)obj)->somFree();
}

somStream_MemoryStreamIO& operator=(somStream_MemoryStreamIO& fromObj)
{
   this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
   return *this;
}

somStream_MemoryStreamIO()
{
   if (*(void**)this != (somStream_MemoryStreamIOCClassData.parentMtab)->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultInit(0);
}

somStream_MemoryStreamIO(somStream_MemoryStreamIO* fromObj)
{
   if (*(void**)this != (somStream_MemoryStreamIOCClassData.parentMtab)->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
}


/*
 * Reintroduce inherited methods
 */

/* method: already_streamed */
boolean   already_streamed(Environment *ev, 
		SOMObject* obj, 
		SOMObject* class_obj)
{
/*
 *  This is called by Streamable objects to detect diamond top situations.
 *  D23362    void write_object_value(in CosStream::Streamable item);
 *  This method writes the data of an object to the StreamIO.  If you call
 *  write_object, the data may or may not be written to the StreamIO, depending
 *  on the implementation of externalize_ref that is being used.
 *  For example, if the object is has persistent references,then the Stream may
 *  just write a stringified reference.  However, write_object_value will always
 *  externalize the object data to the stream (using tag values 1, 2 or 3).
 *  The streamable object should call write_object_value only if it "owns"
 *  the object and wants to force the data to be written.
 *  Note: The default implementation of write_object simply calls write_object_value.
 *  More specialized Stream implementations may write something else, like
 *  a stringified reference.
 *  D23363
 *     void write_key(in CosLifeCycle::Key item);
 *     CosLifeCycle::Key read_key() raises(CosStream::StreamDataFormatError);
 *  The read/write key methods are used by read/write object tag methods
 *  An implementation is provided for these which uses the read/write long
 *  and string.  Subclasses may or may not override.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_already_streamed)(somStream_StreamIOClassData.already_streamed))(((somStream_MemoryStreamIO *)((void *)this)), ev,obj,class_obj)
	);
}


/* method: reset */
void   reset(Environment *ev)
{
/*
 *  Reset current position in stream to the first byte.
 *  Subsequent reads or writes will begin with the first byte in
 *  the stream buffer.
 *  This MUST be overridden by subclasses.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_reset)(somStream_StreamIOClassData.reset))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: set_buffer */
void   set_buffer(Environment *ev, 
		somStream_seq_octet* buffer)
{
/*
 *  Set buffer to copy of this buffer. Client should deallocate buffer.
 *  The current position is reset to the first byte in the buffer.
 *  This MUST be overridden by subclasses.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_set_buffer)(somStream_StreamIOClassData.set_buffer))(((somStream_MemoryStreamIO *)((void *)this)), ev,buffer)
	);
}


/* method: get_buffer */
somStream_seq_octet   get_buffer(Environment *ev)
{
/*
 *  Returns copy of buffer. Client is responsible for deallocating.
 *  The size of the buffer returned to the client is also returned
 *  in the length parameter.
 *  This MUST be overridden by subclasses.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_get_buffer)(somStream_StreamIOClassData.get_buffer))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: clear_buffer */
void   clear_buffer(Environment *ev)
{
/*
 *  Empty the buffer.  Essentially makes the StreamIO just like a new one.
 *  This MUST be overridden by subclasses.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_clear_buffer)(somStream_StreamIOClassData.clear_buffer))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* initializer method: somDefaultInit */
void   somDefaultInit(som3InitCtrl* ctrl)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultInit)(SOMObjectClassData.somDefaultInit))(((somStream_MemoryStreamIO *)((void *)this)),ctrl)
	);
}


/* method: somDestruct */
void   somDestruct(octet doFree, 
		som3DestructCtrl* ctrl)
{
/*
 *  D23363      override: read_object, write_object;
 *       stream: noget;
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDestruct)(SOMObjectClassData.somDestruct))(((somStream_MemoryStreamIO *)((void *)this)),doFree,ctrl)
	);
}


/* method: write_string */
void   write_string(Environment *ev, 
		string item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_string)(CosStream_StreamIOClassData.write_string))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_char */
void   write_char(Environment *ev, 
		char item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_char)(CosStream_StreamIOClassData.write_char))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_octet */
void   write_octet(Environment *ev, 
		octet item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_octet)(CosStream_StreamIOClassData.write_octet))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_unsigned_long */
void   write_unsigned_long(Environment *ev, 
		unsigned long item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_unsigned_long)(CosStream_StreamIOClassData.write_unsigned_long))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_unsigned_short */
void   write_unsigned_short(Environment *ev, 
		unsigned short item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_unsigned_short)(CosStream_StreamIOClassData.write_unsigned_short))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_long */
void   write_long(Environment *ev, 
		long item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_long)(CosStream_StreamIOClassData.write_long))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_short */
void   write_short(Environment *ev, 
		short item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_short)(CosStream_StreamIOClassData.write_short))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_float */
void   write_float(Environment *ev, 
		float item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_float)(CosStream_StreamIOClassData.write_float))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_double */
void   write_double(Environment *ev, 
		double item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_double)(CosStream_StreamIOClassData.write_double))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_boolean */
void   write_boolean(Environment *ev, 
		boolean item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_boolean)(CosStream_StreamIOClassData.write_boolean))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: write_object */
void   write_object(Environment *ev, 
		CosStream_Streamable* item)
{
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_write_object)(CosStream_StreamIOClassData.write_object))(((somStream_MemoryStreamIO *)((void *)this)), ev,item)
	);
}


/* method: read_string */
string   read_string(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_string)(CosStream_StreamIOClassData.read_string))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_char */
char   read_char(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_char)(CosStream_StreamIOClassData.read_char))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_octet */
octet   read_octet(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_octet)(CosStream_StreamIOClassData.read_octet))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_unsigned_long */
unsigned long   read_unsigned_long(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_unsigned_long)(CosStream_StreamIOClassData.read_unsigned_long))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_unsigned_short */
unsigned short   read_unsigned_short(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_unsigned_short)(CosStream_StreamIOClassData.read_unsigned_short))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_long */
long   read_long(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_long)(CosStream_StreamIOClassData.read_long))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_short */
short   read_short(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_short)(CosStream_StreamIOClassData.read_short))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_float */
float   read_float(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_float)(CosStream_StreamIOClassData.read_float))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_double */
double   read_double(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_double)(CosStream_StreamIOClassData.read_double))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* method: read_boolean */
boolean   read_boolean(Environment *ev)
{
/*
 *  D23362
 *     Streamable read_object(in CosLifeCycle::FactoryFinder ff,
 *                            in Streamable obj) raises(StreamDataFormatError);
 * 
 *   The OMG spec also has write_graph() and read_graph() but we omitted
 *   them because compound externalization is not implemented.
 * 
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_StreamIO),
	 ((somTD_somStream_MemoryStreamIO_read_boolean)(CosStream_StreamIOClassData.read_boolean))(((somStream_MemoryStreamIO *)((void *)this)), ev)
	);
}


/* initializer method: somDefaultCopyInit */
void   somDefaultCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor. Use this to make copies of objects for
 *  calling methods with "by-value" argument semantics.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultCopyInit)(SOMObjectClassData.somDefaultCopyInit))(((somStream_MemoryStreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultAssign */
somStream_MemoryStreamIO*  somDefaultAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator. Use this to "assign" the state of one
 *  object to another.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultAssign)(SOMObjectClassData.somDefaultAssign))(((somStream_MemoryStreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstCopyInit */
void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultConstCopyInit)(SOMObjectClassData.somDefaultConstCopyInit))(((somStream_MemoryStreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultVCopyInit */
void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultVCopyInit)(SOMObjectClassData.somDefaultVCopyInit))(((somStream_MemoryStreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstVCopyInit */
void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultConstVCopyInit)(SOMObjectClassData.somDefaultConstVCopyInit))(((somStream_MemoryStreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultConstAssign */
somStream_MemoryStreamIO*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultConstAssign)(SOMObjectClassData.somDefaultConstAssign))(((somStream_MemoryStreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultVAssign */
somStream_MemoryStreamIO*  somDefaultVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a volatile fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultVAssign)(SOMObjectClassData.somDefaultVAssign))(((somStream_MemoryStreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultConstVAssign */
somStream_MemoryStreamIO*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const volatile fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDefaultConstVAssign)(SOMObjectClassData.somDefaultConstVAssign))(((somStream_MemoryStreamIO *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somInit */
void   somInit()
{
/*
 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somInit)(SOMObjectClassData.somInit))(((somStream_MemoryStreamIO *)((void *)this)))
	);
}


/* method: somUninit */
void   somUninit()
{
/*
 *  Obsolete but still supported. Override somDestruct instead of somUninit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somUninit)(SOMObjectClassData.somUninit))(((somStream_MemoryStreamIO *)((void *)this)))
	);
}


/* method: somFree */
void   somFree()
{
/*
 *  The default implementation just calls somDestruct.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somFree)(SOMObjectClassData.somFree))(((somStream_MemoryStreamIO *)((void *)this)))
	);
}


/* method: somGetClass */
SOMClass*   somGetClass()
{
/*
 *  Return the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somGetClass)(SOMObjectClassData.somGetClass))(((somStream_MemoryStreamIO *)((void *)this)))
	);
}


/* method: somGetClassName */
string   somGetClassName()
{
/*
 *  Return the name of the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somGetClassName)(SOMObjectClassData.somGetClassName))(((somStream_MemoryStreamIO *)((void *)this)))
	);
}


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somGetSize)(SOMObjectClassData.somGetSize))(((somStream_MemoryStreamIO *)((void *)this)))
	);
}


/* method: somIsA */
boolean   somIsA(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver responds to methods
 *  introduced by <aClassObj>, and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somIsA)(SOMObjectClassData.somIsA))(((somStream_MemoryStreamIO *)((void *)this)),aClassObj)
	);
}


/* method: somIsInstanceOf */
boolean   somIsInstanceOf(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver is an instance of
 *  <aClassObj> and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somIsInstanceOf)(SOMObjectClassData.somIsInstanceOf))(((somStream_MemoryStreamIO *)((void *)this)),aClassObj)
	);
}


/* method: somRespondsTo */
boolean   somRespondsTo(somId mId)
{
/*
 *  Returns 1 (true) if the indicated method can be invoked
 *  on the receiver and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somRespondsTo)(SOMObjectClassData.somRespondsTo))(((somStream_MemoryStreamIO *)((void *)this)),mId)
	);
}


/* va_list method: somDispatch */

/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 * 
 *  Default redispatch stubs invoke this method.
 */
/* the va_list invocation form */
boolean   SOMObject_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDispatch)(SOMObjectClassData.somDispatch))(((somStream_MemoryStreamIO *)((void *)this)),retValue,methodId,ap)
	);
}

/* the varargs invocation form */
boolean   somDispatch(somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 * 
 *  Default redispatch stubs invoke this method.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDispatch)(SOMObjectClassData.somDispatch))(((somStream_MemoryStreamIO *)((void *)this)),retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* va_list method: somClassDispatch */

/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
/* the va_list invocation form */
boolean   SOMObject_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((somStream_MemoryStreamIO *)((void *)this)),clsObj,retValue,methodId,ap)
	);
}

/* the varargs invocation form */
boolean   somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((somStream_MemoryStreamIO *)((void *)this)),clsObj,retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* method: somCastObj */
boolean   somCastObj(SOMClass* castedCls)
{
/*
 *  Changes the behavior of the target object to that implemented
 *  by castedCls. This is possible when all concrete data in castedCls
 *  is also concrete in the true class of the target object.
 *  Returns true (1) on success, and false (0) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somCastObj)(SOMObjectClassData.somCastObj))(((somStream_MemoryStreamIO *)((void *)this)),castedCls)
	);
}


/* method: somResetObj */
boolean   somResetObj()
{
/*
 *  reset an object to its true class. Returns true always.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somResetObj)(SOMObjectClassData.somResetObj))(((somStream_MemoryStreamIO *)((void *)this)))
	);
}


/* method: somPrintSelf */
somStream_MemoryStreamIO*  somPrintSelf()
{
/*
 *  Uses <SOMOutCharRoutine> to write a brief string with identifying
 *  information about this object.  The default implementation just gives
 *  the object's class name and its address in memory.
 *  <self> is returned.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somPrintSelf)(SOMObjectClassData.somPrintSelf))(((somStream_MemoryStreamIO *)((void *)this)))
	);
}


/* method: somDumpSelf */
void   somDumpSelf(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write a detailed description of this object
 *  and its current state.
 * 
 *  <level> indicates the nesting level for describing compound objects
 *  it must be greater than or equal to zero.  All lines in the
 *  description will be preceeded by <2*level> spaces.
 * 
 *  This routine only actually writes the data that concerns the object
 *  as a whole, such as class, and uses <somDumpSelfInt> to describe
 *  the object's current state.  This approach allows readable
 *  descriptions of compound objects to be constructed.
 * 
 *  Generally it is not necessary to override this method, if it is
 *  overriden it generally must be completely replaced.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDumpSelf)(SOMObjectClassData.somDumpSelf))(((somStream_MemoryStreamIO *)((void *)this)),level)
	);
}


/* method: somDumpSelfInt */
void   somDumpSelfInt(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write in the current state of this object.
 *  Generally this method will need to be overridden.  When overriding
 *  it, begin by calling the parent class form of this method and then
 *  write in a description of your class's instance data. This will
 *  result in a description of all the object's instance data going
 *  from its root ancestor class to its specific class.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_MemoryStreamIO_somDumpSelfInt)(SOMObjectClassData.somDumpSelfInt))(((somStream_MemoryStreamIO *)((void *)this)),level)
	);
}



};   /* somStream_MemoryStreamIO */



#endif       /* SOM_somStream_MemoryStreamIO_xh */

#ifndef SOM_somStream_Streamable_xh
#define SOM_somStream_Streamable_xh


/*
 *  The Streamable interface provides an implementation of the
 *  CosStream::Streamable interface.  It inherits first from ServiceBase
 *  in order to get an implementation of the IdentifiableObject interface.
 *   The following minor codes are used whenever the Externalization Service
 *   raises a system exception (a CORBA standard exception).
 */

#define somStream_Streamable_MajorVersion 3
#define somStream_Streamable_MinorVersion 0
class somStream_Streamable;

/*
 *  The Streamable interface provides an implementation of the
 *  CosStream::Streamable interface.  It inherits first from ServiceBase
 *  in order to get an implementation of the IdentifiableObject interface.
 *   The following minor codes are used whenever the Externalization Service
 *   raises a system exception (a CORBA standard exception).
 */

/* Parents */
#ifndef SOM_somOS_ServiceBase_xh
#ifdef SOMLOCALINCLUDES
#include "somos.xh"
#else
#include <somos.xh>
#endif
#endif
#ifndef SOM_CosStream_Streamable_xh
#ifdef SOMLOCALINCLUDES
#include "omgestio.xh"
#else
#include <omgestio.xh>
#endif
#endif

/* Useful C++ SOM defs */
#include <somcls.xh>
#include <somcm.xh>

#ifndef somStream_Streamable_API
#define somStream_Streamable_API
/*
 * -- The Class API
 */

/*
 * Start of bindings for IDL types
 */


/*
 * End of bindings for IDL types.
 */

/*
 * A function to create the somStream_Streamable class object...
 */
SOMEXTERN SOM_IMPORTEXPORT_somestrm_somestio SOMClass * SOMLINK somStream_StreamableNewClass(
		integer4 majorVersion,
		integer4 minorVersion);


/*
 * The API 2 ClassData Structures...
 */
SOMEXTERN struct somStream_StreamableClassDataStructure {
	SOMClass *classObject;
} SOMDLINK SOM_IMPORTEXPORT_somestrm_somestio somStream_StreamableClassData;
SOMEXTERN struct somStream_StreamableCClassDataStructure {
	som3ClassDetailsPtr    parentMtab;
	somDToken              instanceDataToken;
} SOMDLINK SOM_IMPORTEXPORT_somestrm_somestio somStream_StreamableCClassData;


/*
 * Class Object and Method Token Macros
 */
#define _SOMCLASS_somStream_Streamable (somStream_StreamableClassData.classObject)
#ifndef SOMGD_somStream_Streamable
    #if (defined(_somStream_Streamable) || defined(__somStream_Streamable))
        #undef _somStream_Streamable
        #undef __somStream_Streamable
        #define SOMGD_somStream_Streamable 1
    #else
        #define _somStream_Streamable _SOMCLASS_somStream_Streamable
    #endif /* _somStream_Streamable */
#endif /* SOMGD_somStream_Streamable */
#define somStream_Streamable_classObj _SOMCLASS_somStream_Streamable
#define _SOMMTOKEN_somStream_Streamable(method) ((somMToken)somStream_StreamableClassData.method)

/*
 * -- Typedefs for somStream_Streamable Method Procedures
 */
SOMEXTERN {

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef void   SOMLINK somTP_somStream_Streamable_reinit(somStream_Streamable *somSelf, Environment *ev, 
		somOS_ServiceBase_metastate_t* meta_data);
typedef somTP_somStream_Streamable_reinit *somTD_somStream_Streamable_reinit;
typedef void   SOMLINK somTP_somStream_Streamable_capture(somStream_Streamable *somSelf, Environment *ev, 
		somOS_ServiceBase_metastate_t* meta_data);
typedef somTP_somStream_Streamable_capture *somTD_somStream_Streamable_capture;
typedef SOMObject*   SOMLINK somTP_somStream_Streamable_GetInstanceManager(somStream_Streamable *somSelf, Environment *ev);
typedef somTP_somStream_Streamable_GetInstanceManager *somTD_somStream_Streamable_GetInstanceManager;
typedef SOMObject*   SOMLINK somTP_somStream_Streamable_init_for_object_creation(somStream_Streamable *somSelf, Environment *ev);
typedef somTP_somStream_Streamable_init_for_object_creation *somTD_somStream_Streamable_init_for_object_creation;
typedef SOMObject*   SOMLINK somTP_somStream_Streamable_init_for_object_reactivation(somStream_Streamable *somSelf, Environment *ev);
typedef somTP_somStream_Streamable_init_for_object_reactivation *somTD_somStream_Streamable_init_for_object_reactivation;
typedef SOMObject*   SOMLINK somTP_somStream_Streamable_init_for_object_copy(somStream_Streamable *somSelf, Environment *ev);
typedef somTP_somStream_Streamable_init_for_object_copy *somTD_somStream_Streamable_init_for_object_copy;
typedef void   SOMLINK somTP_somStream_Streamable_uninit_for_object_move(somStream_Streamable *somSelf, Environment *ev);
typedef somTP_somStream_Streamable_uninit_for_object_move *somTD_somStream_Streamable_uninit_for_object_move;
typedef void   SOMLINK somTP_somStream_Streamable_uninit_for_object_passivation(somStream_Streamable *somSelf, Environment *ev);
typedef somTP_somStream_Streamable_uninit_for_object_passivation *somTD_somStream_Streamable_uninit_for_object_passivation;
typedef void   SOMLINK somTP_somStream_Streamable_uninit_for_object_destruction(somStream_Streamable *somSelf, Environment *ev);
typedef somTP_somStream_Streamable_uninit_for_object_destruction *somTD_somStream_Streamable_uninit_for_object_destruction;
typedef void   SOMLINK somTP_somStream_Streamable_somDefaultInit(somStream_Streamable *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_somStream_Streamable_somDefaultInit *somTD_somStream_Streamable_somDefaultInit;
typedef void   SOMLINK somTP_somStream_Streamable_somDestruct(somStream_Streamable *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_somStream_Streamable_somDestruct *somTD_somStream_Streamable_somDestruct;
typedef boolean   SOMLINK somTP_somStream_Streamable_is_identical(somStream_Streamable *somSelf, Environment *ev, 
		CosObjectIdentity_IdentifiableObject* other_object);
typedef somTP_somStream_Streamable_is_identical *somTD_somStream_Streamable_is_identical;
typedef CosObjectIdentity_ObjectIdentifier   SOMLINK somTP_somStream_Streamable__get_constant_random_id(somStream_Streamable *somSelf, Environment *ev);
typedef somTP_somStream_Streamable__get_constant_random_id *somTD_somStream_Streamable__get_constant_random_id;
typedef void   SOMLINK somTP_somStream_Streamable_somDefaultCopyInit(somStream_Streamable *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_Streamable_somDefaultCopyInit *somTD_somStream_Streamable_somDefaultCopyInit;
typedef somStream_Streamable*   SOMLINK somTP_somStream_Streamable_somDefaultAssign(somStream_Streamable *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_Streamable_somDefaultAssign *somTD_somStream_Streamable_somDefaultAssign;
typedef void   SOMLINK somTP_somStream_Streamable_somDefaultConstCopyInit(somStream_Streamable *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_Streamable_somDefaultConstCopyInit *somTD_somStream_Streamable_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_somStream_Streamable_somDefaultVCopyInit(somStream_Streamable *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_Streamable_somDefaultVCopyInit *somTD_somStream_Streamable_somDefaultVCopyInit;
typedef void   SOMLINK somTP_somStream_Streamable_somDefaultConstVCopyInit(somStream_Streamable *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_Streamable_somDefaultConstVCopyInit *somTD_somStream_Streamable_somDefaultConstVCopyInit;
typedef somStream_Streamable*   SOMLINK somTP_somStream_Streamable_somDefaultConstAssign(somStream_Streamable *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_Streamable_somDefaultConstAssign *somTD_somStream_Streamable_somDefaultConstAssign;
typedef somStream_Streamable*   SOMLINK somTP_somStream_Streamable_somDefaultVAssign(somStream_Streamable *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_Streamable_somDefaultVAssign *somTD_somStream_Streamable_somDefaultVAssign;
typedef somStream_Streamable*   SOMLINK somTP_somStream_Streamable_somDefaultConstVAssign(somStream_Streamable *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_somStream_Streamable_somDefaultConstVAssign *somTD_somStream_Streamable_somDefaultConstVAssign;
typedef void   SOMLINK somTP_somStream_Streamable_somInit(somStream_Streamable *somSelf);
typedef somTP_somStream_Streamable_somInit *somTD_somStream_Streamable_somInit;
typedef void   SOMLINK somTP_somStream_Streamable_somUninit(somStream_Streamable *somSelf);
typedef somTP_somStream_Streamable_somUninit *somTD_somStream_Streamable_somUninit;
typedef void   SOMLINK somTP_somStream_Streamable_somFree(somStream_Streamable *somSelf);
typedef somTP_somStream_Streamable_somFree *somTD_somStream_Streamable_somFree;
typedef SOMClass*   SOMLINK somTP_somStream_Streamable_somGetClass(somStream_Streamable *somSelf);
typedef somTP_somStream_Streamable_somGetClass *somTD_somStream_Streamable_somGetClass;
typedef string   SOMLINK somTP_somStream_Streamable_somGetClassName(somStream_Streamable *somSelf);
typedef somTP_somStream_Streamable_somGetClassName *somTD_somStream_Streamable_somGetClassName;
typedef long   SOMLINK somTP_somStream_Streamable_somGetSize(somStream_Streamable *somSelf);
typedef somTP_somStream_Streamable_somGetSize *somTD_somStream_Streamable_somGetSize;
typedef boolean   SOMLINK somTP_somStream_Streamable_somIsA(somStream_Streamable *somSelf, 
		SOMClass* aClassObj);
typedef somTP_somStream_Streamable_somIsA *somTD_somStream_Streamable_somIsA;
typedef boolean   SOMLINK somTP_somStream_Streamable_somIsInstanceOf(somStream_Streamable *somSelf, 
		SOMClass* aClassObj);
typedef somTP_somStream_Streamable_somIsInstanceOf *somTD_somStream_Streamable_somIsInstanceOf;
typedef boolean   SOMLINK somTP_somStream_Streamable_somRespondsTo(somStream_Streamable *somSelf, 
		somId mId);
typedef somTP_somStream_Streamable_somRespondsTo *somTD_somStream_Streamable_somRespondsTo;
typedef boolean   SOMLINK somTP_somStream_Streamable_somDispatch(somStream_Streamable *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_somStream_Streamable_somDispatch *somTD_somStream_Streamable_somDispatch;
typedef boolean   SOMLINK somTP_somStream_Streamable_somClassDispatch(somStream_Streamable *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_somStream_Streamable_somClassDispatch *somTD_somStream_Streamable_somClassDispatch;
typedef boolean   SOMLINK somTP_somStream_Streamable_somCastObj(somStream_Streamable *somSelf, 
		SOMClass* castedCls);
typedef somTP_somStream_Streamable_somCastObj *somTD_somStream_Streamable_somCastObj;
typedef boolean   SOMLINK somTP_somStream_Streamable_somResetObj(somStream_Streamable *somSelf);
typedef somTP_somStream_Streamable_somResetObj *somTD_somStream_Streamable_somResetObj;
typedef somStream_Streamable*   SOMLINK somTP_somStream_Streamable_somPrintSelf(somStream_Streamable *somSelf);
typedef somTP_somStream_Streamable_somPrintSelf *somTD_somStream_Streamable_somPrintSelf;
typedef void   SOMLINK somTP_somStream_Streamable_somDumpSelf(somStream_Streamable *somSelf, 
		long level);
typedef somTP_somStream_Streamable_somDumpSelf *somTD_somStream_Streamable_somDumpSelf;
typedef void   SOMLINK somTP_somStream_Streamable_somDumpSelfInt(somStream_Streamable *somSelf, 
		long level);
typedef somTP_somStream_Streamable_somDumpSelfInt *somTD_somStream_Streamable_somDumpSelfInt;
typedef void   SOMLINK somTP_somStream_Streamable_externalize_to_stream(somStream_Streamable *somSelf, Environment *ev, 
		CosStream_StreamIO* stream);
typedef somTP_somStream_Streamable_externalize_to_stream *somTD_somStream_Streamable_externalize_to_stream;
typedef void   SOMLINK somTP_somStream_Streamable_internalize_from_stream(somStream_Streamable *somSelf, Environment *ev, 
		CosStream_StreamIO* stream, 
		CosLifeCycle_FactoryFinder* ff);
typedef somTP_somStream_Streamable_internalize_from_stream *somTD_somStream_Streamable_internalize_from_stream;
}

#endif /* somStream_Streamable_API */


/*
 * -- The C++ Wrapper Class for somStream_Streamable
 */
class somStream_Streamable : public somOS_ServiceBase, public CosStream_Streamable
{
/*
 *  The Streamable interface provides an implementation of the
 *  CosStream::Streamable interface.  It inherits first from ServiceBase
 *  in order to get an implementation of the IdentifiableObject interface.
 *   The following minor codes are used whenever the Externalization Service
 *   raises a system exception (a CORBA standard exception).
 */
public:

// somStream_Streamable::new creates the class object if necessary, and then uses
// somNewNoInit to allocate memory and create the object.
// Initialization is in ctors.
void *operator new(size_t)
{
   if (!_somStream_Streamable) somStream_StreamableNewClass(somStream_Streamable_MajorVersion,somStream_Streamable_MinorVersion);
   return (void*)
   (((somTD_SOMClass_somNewNoInit)(SOMClassClassData.somNewNoInit))
         ((SOMClass *)((void*)_somStream_Streamable)));
}

// somStream_Streamable::delete uses somFree.
void operator delete(void * obj)
{
   if (obj && *(void**)obj)
      ((SOMObject*)obj)->somFree();
}

somStream_Streamable& operator=(somStream_Streamable& fromObj)
{
   this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
   return *this;
}

somStream_Streamable()
{
   if (*(void**)this != (somStream_StreamableCClassData.parentMtab)->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultInit(0);
}

somStream_Streamable(somStream_Streamable* fromObj)
{
   if (*(void**)this != (somStream_StreamableCClassData.parentMtab)->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
}


/*
 * Reintroduce inherited methods
 */

/* method: reinit */
void   reinit(Environment *ev, 
		somOS_ServiceBase_metastate_t* meta_data)
{
/*
 *  - somOS::Server calls this method when (1) an object is reactivated
 *    (in somdSOMObjFromRef()) and (2) somOS::Server is asked to
 *    restore_metastate().
 *  - Services should override it do reinitialization using meta_data.
 *  - reinitializes the identity metadata
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_reinit)(somOS_ServiceBaseClassData.reinit))(((somStream_Streamable *)((void *)this)), ev,meta_data)
	);
}


/* method: capture */
void   capture(Environment *ev, 
		somOS_ServiceBase_metastate_t* meta_data)
{
/*
 *  - somos::Server call this method from store_metastate().
 *  - Services should override this method to supply proper metadata.
 *  - Capture() must free typecode in
 *           meta_data._buffer[service_id].service_metastate._type
 *     and data in ...._buffer prior to filling it using SOMFree
 *  - Allocates memory to store metastate. It is somOS::Server's
 *    resposibility to free the metastate returned by services.
 *  - captures identity metadata
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_capture)(somOS_ServiceBaseClassData.capture))(((somStream_Streamable *)((void *)this)), ev,meta_data)
	);
}


/* method: GetInstanceManager */
SOMObject*   GetInstanceManager(Environment *ev)
{
/*
 *  - Returns the server object which is either
 *             an instance somOS::Server,
 *         OR  an instance of SOMDServer,
 *         OR  OBJECT_NIL
 *  This method is usually not overriden.
 *  This method allows clients to get a reference to the server
 *  object. It is introduced as somdFindServer... methods have been
 *  deprecated.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_GetInstanceManager)(somOS_ServiceBaseClassData.GetInstanceManager))(((somStream_Streamable *)((void *)this)), ev)
	);
}


/* method: init_for_object_creation */
SOMObject*   init_for_object_creation(Environment *ev)
{
/*
 *  somOS::somOS::Server calls this method from somdCreateObj().
 *  - Services should override this method to do proper initialization
 *    at the time of object creation. (if necessary)
 *  - it initializes the data for CosObjectIdentity
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_init_for_object_creation)(somOS_ServiceBaseClassData.init_for_object_creation))(((somStream_Streamable *)((void *)this)), ev)
	);
}


/* method: init_for_object_reactivation */
SOMObject*   init_for_object_reactivation(Environment *ev)
{
/*
 *  - somOS::Server calls this method when an object is reactivated
 *    in somdSOMObjFromRef() (but prior to calling reinit())
 *  - Services should override this method to do proper initialization
 *    at the time of object reactivation. (if necessary)
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_init_for_object_reactivation)(somOS_ServiceBaseClassData.init_for_object_reactivation))(((somStream_Streamable *)((void *)this)), ev)
	);
}


/* method: init_for_object_copy */
SOMObject*   init_for_object_copy(Environment *ev)
{
/*
 *  Abstract method.
 *  - Services should override this method to do proper initialization
 *    at the time of object copy. (if necessary)
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_init_for_object_copy)(somOS_ServiceBaseClassData.init_for_object_copy))(((somStream_Streamable *)((void *)this)), ev)
	);
}


/* method: uninit_for_object_move */
void   uninit_for_object_move(Environment *ev)
{
/*
 *  Abstract method.
 *  - Services should override this method to do proper uninitialization
 *    at the time of object move. (if necessary)
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_uninit_for_object_move)(somOS_ServiceBaseClassData.uninit_for_object_move))(((somStream_Streamable *)((void *)this)), ev)
	);
}


/* method: uninit_for_object_passivation */
void   uninit_for_object_passivation(Environment *ev)
{
/*
 *  - Asks somOS::Server to remove an entry from reference-data-table.
 *  - No exceptions are raised. If there is no entry in the
 *    reference-data-table then the operation is considered to be successful.
 *  - somOS::Server calls this method when an object is passivated
 *    (passivate_object()).
 *  - Services should override this method to do proper uninitialization
 *    at the time of object passivation. (if necessary)
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_uninit_for_object_passivation)(somOS_ServiceBaseClassData.uninit_for_object_passivation))(((somStream_Streamable *)((void *)this)), ev)
	);
}


/* method: uninit_for_object_destruction */
void   uninit_for_object_destruction(Environment *ev)
{
/*
 *  - somOS::Server calls this method when a properly initialized object
 *    is destroyed. In particular, from somdDeleteObj().
 *  - Services should override this method to do proper uninitialization
 *    at the time of object destruction. (if necessary)
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_somOS_ServiceBase),
	 ((somTD_somStream_Streamable_uninit_for_object_destruction)(somOS_ServiceBaseClassData.uninit_for_object_destruction))(((somStream_Streamable *)((void *)this)), ev)
	);
}


/* initializer method: somDefaultInit */
void   somDefaultInit(som3InitCtrl* ctrl)
{
/*
 *  For efficiency
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultInit)(SOMObjectClassData.somDefaultInit))(((somStream_Streamable *)((void *)this)),ctrl)
	);
}


/* method: somDestruct */
void   somDestruct(octet doFree, 
		som3DestructCtrl* ctrl)
{
/*
 *  Attempt to remove the entry for the object in the reference data table
 *  by calling remove_from_reference_data_table on the server.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDestruct)(SOMObjectClassData.somDestruct))(((somStream_Streamable *)((void *)this)),doFree,ctrl)
	);
}


/* method: is_identical */
boolean   is_identical(Environment *ev, 
		CosObjectIdentity_IdentifiableObject* other_object)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosObjectIdentity_IdentifiableObject),
	 ((somTD_somStream_Streamable_is_identical)(CosObjectIdentity_IdentifiableObjectClassData.is_identical))(((somStream_Streamable *)((void *)this)), ev,other_object)
	);
}


/* method: _get_constant_random_id */
CosObjectIdentity_ObjectIdentifier   _get_constant_random_id(Environment *ev)
{
   return 	(
	 SOM_TestCls(this,_SOMCLASS_CosObjectIdentity_IdentifiableObject),
	 ((somTD_somStream_Streamable__get_constant_random_id)(CosObjectIdentity_IdentifiableObjectClassData._get_constant_random_id))(((somStream_Streamable *)((void *)this)), ev)
	);
}


/* initializer method: somDefaultCopyInit */
void   somDefaultCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor. Use this to make copies of objects for
 *  calling methods with "by-value" argument semantics.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultCopyInit)(SOMObjectClassData.somDefaultCopyInit))(((somStream_Streamable *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultAssign */
somStream_Streamable*  somDefaultAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator. Use this to "assign" the state of one
 *  object to another.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultAssign)(SOMObjectClassData.somDefaultAssign))(((somStream_Streamable *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstCopyInit */
void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultConstCopyInit)(SOMObjectClassData.somDefaultConstCopyInit))(((somStream_Streamable *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultVCopyInit */
void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultVCopyInit)(SOMObjectClassData.somDefaultVCopyInit))(((somStream_Streamable *)((void *)this)),ctrl,fromObj)
	);
}


/* initializer method: somDefaultConstVCopyInit */
void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const volatile fromObj.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultConstVCopyInit)(SOMObjectClassData.somDefaultConstVCopyInit))(((somStream_Streamable *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultConstAssign */
somStream_Streamable*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultConstAssign)(SOMObjectClassData.somDefaultConstAssign))(((somStream_Streamable *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultVAssign */
somStream_Streamable*  somDefaultVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a volatile fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultVAssign)(SOMObjectClassData.somDefaultVAssign))(((somStream_Streamable *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somDefaultConstVAssign */
somStream_Streamable*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const volatile fromObj.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDefaultConstVAssign)(SOMObjectClassData.somDefaultConstVAssign))(((somStream_Streamable *)((void *)this)),ctrl,fromObj)
	);
}


/* method: somInit */
void   somInit()
{
/*
 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somInit)(SOMObjectClassData.somInit))(((somStream_Streamable *)((void *)this)))
	);
}


/* method: somUninit */
void   somUninit()
{
/*
 *  Obsolete but still supported. Override somDestruct instead of somUninit.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somUninit)(SOMObjectClassData.somUninit))(((somStream_Streamable *)((void *)this)))
	);
}


/* method: somFree */
void   somFree()
{
/*
 *  The default implementation just calls somDestruct.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somFree)(SOMObjectClassData.somFree))(((somStream_Streamable *)((void *)this)))
	);
}


/* method: somGetClass */
SOMClass*   somGetClass()
{
/*
 *  Return the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somGetClass)(SOMObjectClassData.somGetClass))(((somStream_Streamable *)((void *)this)))
	);
}


/* method: somGetClassName */
string   somGetClassName()
{
/*
 *  Return the name of the receiver's class.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somGetClassName)(SOMObjectClassData.somGetClassName))(((somStream_Streamable *)((void *)this)))
	);
}


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somGetSize)(SOMObjectClassData.somGetSize))(((somStream_Streamable *)((void *)this)))
	);
}


/* method: somIsA */
boolean   somIsA(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver responds to methods
 *  introduced by <aClassObj>, and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somIsA)(SOMObjectClassData.somIsA))(((somStream_Streamable *)((void *)this)),aClassObj)
	);
}


/* method: somIsInstanceOf */
boolean   somIsInstanceOf(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver is an instance of
 *  <aClassObj> and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somIsInstanceOf)(SOMObjectClassData.somIsInstanceOf))(((somStream_Streamable *)((void *)this)),aClassObj)
	);
}


/* method: somRespondsTo */
boolean   somRespondsTo(somId mId)
{
/*
 *  Returns 1 (true) if the indicated method can be invoked
 *  on the receiver and 0 (false) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somRespondsTo)(SOMObjectClassData.somRespondsTo))(((somStream_Streamable *)((void *)this)),mId)
	);
}


/* va_list method: somDispatch */

/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 * 
 *  Default redispatch stubs invoke this method.
 */
/* the va_list invocation form */
boolean   SOMObject_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDispatch)(SOMObjectClassData.somDispatch))(((somStream_Streamable *)((void *)this)),retValue,methodId,ap)
	);
}

/* the varargs invocation form */
boolean   somDispatch(somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 * 
 *  Default redispatch stubs invoke this method.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDispatch)(SOMObjectClassData.somDispatch))(((somStream_Streamable *)((void *)this)),retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* va_list method: somClassDispatch */

/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
/* the va_list invocation form */
boolean   SOMObject_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((somStream_Streamable *)((void *)this)),clsObj,retValue,methodId,ap)
	);
}

/* the varargs invocation form */
boolean   somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somClassDispatch)(SOMObjectClassData.somClassDispatch))(((somStream_Streamable *)((void *)this)),clsObj,retValue,methodId,ap)
	);
   va_end(ap);
   return __somResult;
}


/* method: somCastObj */
boolean   somCastObj(SOMClass* castedCls)
{
/*
 *  Changes the behavior of the target object to that implemented
 *  by castedCls. This is possible when all concrete data in castedCls
 *  is also concrete in the true class of the target object.
 *  Returns true (1) on success, and false (0) otherwise.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somCastObj)(SOMObjectClassData.somCastObj))(((somStream_Streamable *)((void *)this)),castedCls)
	);
}


/* method: somResetObj */
boolean   somResetObj()
{
/*
 *  reset an object to its true class. Returns true always.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somResetObj)(SOMObjectClassData.somResetObj))(((somStream_Streamable *)((void *)this)))
	);
}


/* method: somPrintSelf */
somStream_Streamable*  somPrintSelf()
{
/*
 *  Uses <SOMOutCharRoutine> to write a brief string with identifying
 *  information about this object.  The default implementation just gives
 *  the object's class name and its address in memory.
 *  <self> is returned.
 */
   return 	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somPrintSelf)(SOMObjectClassData.somPrintSelf))(((somStream_Streamable *)((void *)this)))
	);
}


/* method: somDumpSelf */
void   somDumpSelf(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write a detailed description of this object
 *  and its current state.
 * 
 *  <level> indicates the nesting level for describing compound objects
 *  it must be greater than or equal to zero.  All lines in the
 *  description will be preceeded by <2*level> spaces.
 * 
 *  This routine only actually writes the data that concerns the object
 *  as a whole, such as class, and uses <somDumpSelfInt> to describe
 *  the object's current state.  This approach allows readable
 *  descriptions of compound objects to be constructed.
 * 
 *  Generally it is not necessary to override this method, if it is
 *  overriden it generally must be completely replaced.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDumpSelf)(SOMObjectClassData.somDumpSelf))(((somStream_Streamable *)((void *)this)),level)
	);
}


/* method: somDumpSelfInt */
void   somDumpSelfInt(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write in the current state of this object.
 *  Generally this method will need to be overridden.  When overriding
 *  it, begin by calling the parent class form of this method and then
 *  write in a description of your class's instance data. This will
 *  result in a description of all the object's instance data going
 *  from its root ancestor class to its specific class.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_SOMObject),
	 ((somTD_somStream_Streamable_somDumpSelfInt)(SOMObjectClassData.somDumpSelfInt))(((somStream_Streamable *)((void *)this)),level)
	);
}


/* method: externalize_to_stream */
void   externalize_to_stream(Environment *ev, 
		CosStream_StreamIO* stream)
{
/*
 *  This method must be overridden.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_Streamable),
	 ((somTD_somStream_Streamable_externalize_to_stream)(CosStream_StreamableClassData.externalize_to_stream))(((somStream_Streamable *)((void *)this)), ev,stream)
	);
}


/* method: internalize_from_stream */
void   internalize_from_stream(Environment *ev, 
		CosStream_StreamIO* stream, 
		CosLifeCycle_FactoryFinder* ff)
{
/*
 *  This method must be overridden.
 *  D23362
 *     readonly attribute CosLifeCycle::Key external_form_id;
 *  The write_object method puts this attribute into the stream so that
 *  read_object can create a new object.
 */
   	(
	 SOM_TestCls(this,_SOMCLASS_CosStream_Streamable),
	 ((somTD_somStream_Streamable_internalize_from_stream)(CosStream_StreamableClassData.internalize_from_stream))(((somStream_Streamable *)((void *)this)), ev,stream,ff)
	);
}



};   /* somStream_Streamable */



#endif       /* SOM_somStream_Streamable_xh */
