#ifndef __X10_IO_WRITER_H
#define __X10_IO_WRITER_H

#include <x10rt.h>


#define X10_LANG_OBJECT_H_NODEPS
#include <x10/lang/Object.h>
#undef X10_LANG_OBJECT_H_NODEPS
namespace x10 { namespace lang { 
class Byte;
} } 
namespace x10 { namespace io { 
class Marshal__ByteMarshal;
} } 
namespace x10 { namespace io { 
template<class TPMGL(T)> class Marshal;
} } 
namespace x10 { namespace lang { 
class UByte;
} } 
namespace x10 { namespace io { 
class Marshal__UByteMarshal;
} } 
namespace x10 { namespace lang { 
class Char;
} } 
namespace x10 { namespace io { 
class Marshal__CharMarshal;
} } 
namespace x10 { namespace lang { 
class Short;
} } 
namespace x10 { namespace io { 
class Marshal__ShortMarshal;
} } 
namespace x10 { namespace lang { 
class UShort;
} } 
namespace x10 { namespace io { 
class Marshal__UShortMarshal;
} } 
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace io { 
class Marshal__IntMarshal;
} } 
namespace x10 { namespace lang { 
class UInt;
} } 
namespace x10 { namespace io { 
class Marshal__UIntMarshal;
} } 
namespace x10 { namespace lang { 
class Long;
} } 
namespace x10 { namespace io { 
class Marshal__LongMarshal;
} } 
namespace x10 { namespace lang { 
class ULong;
} } 
namespace x10 { namespace io { 
class Marshal__ULongMarshal;
} } 
namespace x10 { namespace lang { 
class Float;
} } 
namespace x10 { namespace io { 
class Marshal__FloatMarshal;
} } 
namespace x10 { namespace lang { 
class Double;
} } 
namespace x10 { namespace io { 
class Marshal__DoubleMarshal;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace io { 
class Marshal__BooleanMarshal;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace io { 
class OutputStreamWriter__OutputStream;
} } 
namespace x10 { namespace compiler { 
class Native;
} } 
namespace x10 { namespace io { 

class Writer : public x10::lang::Object   {
    public:
    RTT_H_DECLS_CLASS
    
    virtual void close() = 0;
    virtual void flush() = 0;
    virtual void write(x10_byte x) = 0;
    virtual void writeByte(x10_byte x);
    virtual void writeUByte(x10_ubyte x);
    virtual void writeChar(x10_char x);
    virtual void writeShort(x10_short x);
    virtual void writeUShort(x10_ushort x);
    virtual void writeInt(x10_int x);
    virtual void writeUInt(x10_uint x);
    virtual void writeLong(x10_long x);
    virtual void writeULong(x10_ulong x);
    virtual void writeFloat(x10_float x);
    virtual void writeDouble(x10_double x);
    virtual void writeBoolean(x10_boolean x);
    template<class TPMGL(T)> void write(x10aux::ref<x10::io::Marshal<TPMGL(T)> > m,
                                        TPMGL(T) x);
    virtual void write(x10aux::ref<x10::array::Array<x10_byte> > buf);
    virtual void write(x10aux::ref<x10::array::Array<x10_byte> > buf,
                       x10_int off, x10_int len);
    virtual x10aux::ref<x10::io::OutputStreamWriter__OutputStream>
      getNativeOutputStream();
    virtual x10aux::ref<x10::io::Writer> x10__io__Writer____x10__io__Writer__this(
      );
    void _constructor();
    
    
    // Serialization
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};

} } 
#endif // X10_IO_WRITER_H

namespace x10 { namespace io { 
class Writer;
} } 

#ifndef X10_IO_WRITER_H_NODEPS
#define X10_IO_WRITER_H_NODEPS
#include <x10/lang/Object.h>
#include <x10/lang/Byte.h>
#include <x10/io/Marshal__ByteMarshal.h>
#include <x10/io/Marshal.h>
#include <x10/lang/UByte.h>
#include <x10/io/Marshal__UByteMarshal.h>
#include <x10/lang/Char.h>
#include <x10/io/Marshal__CharMarshal.h>
#include <x10/lang/Short.h>
#include <x10/io/Marshal__ShortMarshal.h>
#include <x10/lang/UShort.h>
#include <x10/io/Marshal__UShortMarshal.h>
#include <x10/lang/Int.h>
#include <x10/io/Marshal__IntMarshal.h>
#include <x10/lang/UInt.h>
#include <x10/io/Marshal__UIntMarshal.h>
#include <x10/lang/Long.h>
#include <x10/io/Marshal__LongMarshal.h>
#include <x10/lang/ULong.h>
#include <x10/io/Marshal__ULongMarshal.h>
#include <x10/lang/Float.h>
#include <x10/io/Marshal__FloatMarshal.h>
#include <x10/lang/Double.h>
#include <x10/io/Marshal__DoubleMarshal.h>
#include <x10/lang/Boolean.h>
#include <x10/io/Marshal__BooleanMarshal.h>
#include <x10/array/Array.h>
#include <x10/io/OutputStreamWriter__OutputStream.h>
#include <x10/compiler/Native.h>
#ifndef X10_IO_WRITER_H_GENERICS
#define X10_IO_WRITER_H_GENERICS
#ifndef X10_IO_WRITER_H_write_994
#define X10_IO_WRITER_H_write_994
template<class TPMGL(T)> void x10::io::Writer::write(x10aux::ref<x10::io::Marshal<TPMGL(T)> > m,
                                                     TPMGL(T) x) {
    
    //#line 61 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/io/Writer.x10": Eval of x10.ast.X10Call_c
    x10::io::Marshal<TPMGL(T)>::write(x10aux::nullCheck(m), ((x10aux::ref<x10::io::Writer>)this),
                                                            x);
}
#endif // X10_IO_WRITER_H_write_994
#endif // X10_IO_WRITER_H_GENERICS
#endif // __X10_IO_WRITER_H_NODEPS
