// **********************************************************************
//
// Copyright (c) 2002
// IONA Technologies, Inc.
// Waltham, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef CUSTOM_IDL
#define CUSTOM_IDL

#include <OB/TypeCode.idl>
#include <OB/Types.idl>
#include <OB/Native.idl>

#pragma prefix "omg.org"

module CORBA
{

//
// Stream valuetypes for use in custom marshalling
//

abstract valuetype DataOutputStream
{
    void write_any(in any value);
    void write_boolean(in boolean value);
    void write_char(in char value);
    void write_wchar(in wchar value);
    void write_octet(in octet value);
    void write_short(in short value);
    void write_ushort(in unsigned short value);
    void write_long(in long value);
    void write_ulong(in unsigned long value);
    void write_longlong(in long long value);
    void write_ulonglong(in unsigned long long value);
    void write_float(in float value);
    void write_double(in double value);
#ifdef OB_CPLUSPLUS
    void write_longdouble(in long double value);
#endif
    void write_string(in string value);
    void write_wstring(in wstring value);
    void write_Object(in Object value);
    void write_Abstract(in AbstractBase value);
    void write_Value(in ValueBase value);
    void write_TypeCode(in TypeCode value);

    void write_any_array(in AnySeq seq,
                         in unsigned long offset,
                         in unsigned long length);
    void write_boolean_array(in BooleanSeq seq,
                             in unsigned long offset,
                             in unsigned long length);
    void write_char_array(in CharSeq seq,
                          in unsigned long offset,
                          in unsigned long length);
    void write_wchar_array(in WCharSeq seq,
                           in unsigned long offset,
                           in unsigned long length);
    void write_octet_array(in OctetSeq seq,
                           in unsigned long offset,
                           in unsigned long length);
    void write_short_array(in ShortSeq seq,
                           in unsigned long offset,
                           in unsigned long length);
    void write_ushort_array(in UShortSeq seq,
                            in unsigned long offset,
                            in unsigned long length);
    void write_long_array(in LongSeq seq,
                          in unsigned long offset,
                          in unsigned long length);
    void write_ulong_array(in ULongSeq seq,
                           in unsigned long offset,
                           in unsigned long length);
    void write_ulonglong_array(in ULongLongSeq seq,
                               in unsigned long offset,
                               in unsigned long length);
    void write_longlong_array(in LongLongSeq seq,
                              in unsigned long offset,
                              in unsigned long length);
    void write_float_array(in FloatSeq seq,
                           in unsigned long offset,
                           in unsigned long length);
    void write_double_array(in DoubleSeq seq,
                            in unsigned long offset,
                            in unsigned long length);
};

abstract valuetype DataInputStream
{
    any read_any();
    boolean read_boolean();
    char read_char();
    wchar read_wchar();
    octet read_octet();
    short read_short();
    unsigned short read_ushort();
    long read_long();
    unsigned long read_ulong();
    long long read_longlong();
    unsigned long long read_ulonglong();
    float read_float();
    double read_double();
#ifdef OB_CPLUSPLUS
    long double read_longdouble();
#endif
    string read_string();
    wstring read_wstring();
    Object read_Object();
    AbstractBase read_Abstract();
    ValueBase read_Value();
    TypeCode read_TypeCode();

    void read_any_array(inout AnySeq seq,
                        in unsigned long offset,
                        in unsigned long length);
    void read_boolean_array(inout BooleanSeq seq,
                            in unsigned long offset,
                            in unsigned long length);
    void read_char_array(inout CharSeq seq,
                         in unsigned long offset,
                         in unsigned long length);
    void read_wchar_array(inout WCharSeq seq,
                          in unsigned long offset,
                          in unsigned long length);
    void read_octet_array(inout OctetSeq seq,
                          in unsigned long offset,
                          in unsigned long length);
    void read_short_array(inout ShortSeq seq,
                          in unsigned long offset,
                          in unsigned long length);
    void read_ushort_array(inout UShortSeq seq,
                           in unsigned long offset,
                           in unsigned long length);
    void read_long_array(inout LongSeq seq,
                         in unsigned long offset,
                         in unsigned long length);
    void read_ulong_array(inout ULongSeq seq,
                          in unsigned long offset,
                          in unsigned long length);
    void read_ulonglong_array(inout ULongLongSeq seq,
                              in unsigned long offset,
                              in unsigned long length);
    void read_longlong_array(inout LongLongSeq seq,
                             in unsigned long offset,
                             in unsigned long length);
    void read_float_array(inout FloatSeq seq,
                          in unsigned long offset,
                          in unsigned long length);
    void read_double_array(inout DoubleSeq seq,
                           in unsigned long offset,
                           in unsigned long length);
};

#ifdef OB_CPLUSPLUS
abstract valuetype CustomMarshal
{
    void marshal(in DataOutputStream os);
    void unmarshal(in DataInputStream is);
};
#endif

}; // End of module CORBA

#endif
