#ifndef __X10_IO_READER_H
#define __X10_IO_READER_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 lang { 
class Int;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace io { 
class Marshal__BooleanMarshal;
} } 
namespace x10 { namespace io { 
template<class TPMGL(T)> class Marshal;
} } 
namespace x10 { namespace io { 
class Marshal__ByteMarshal;
} } 
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 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 String;
} } 
namespace x10 { namespace io { 
class Marshal__LineMarshal;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace io { 
template<class TPMGL(T)> class ReaderIterator;
} } 
namespace x10 { namespace io { 

class Reader : public x10::lang::Object   {
    public:
    RTT_H_DECLS_CLASS
    
    virtual void close() = 0;
    virtual x10_byte read() = 0;
    virtual x10_int available() = 0;
    virtual void skip(x10_int id__115) = 0;
    virtual void mark(x10_int id__116) = 0;
    virtual void reset() = 0;
    virtual x10_boolean markSupported() = 0;
    virtual x10_boolean readBoolean();
    virtual x10_byte readByte();
    virtual x10_ubyte readUByte();
    virtual x10_char readChar();
    virtual x10_short readShort();
    virtual x10_ushort readUShort();
    virtual x10_int readInt();
    virtual x10_uint readUInt();
    virtual x10_long readLong();
    virtual x10_ulong readULong();
    virtual x10_float readFloat();
    virtual x10_double readDouble();
    virtual x10aux::ref<x10::lang::String> readLine();
    template<class TPMGL(T)> TPMGL(T) read(x10aux::ref<x10::io::Marshal<TPMGL(T)> > m);
    template<class TPMGL(T)> void read(x10aux::ref<x10::io::Marshal<TPMGL(T)> > m,
                                       x10aux::ref<x10::array::Array<TPMGL(T)> > a);
    template<class TPMGL(T)> void read(x10aux::ref<x10::io::Marshal<TPMGL(T)> > m,
                                       x10aux::ref<x10::array::Array<TPMGL(T)> > a,
                                       x10_int off, x10_int len);
    virtual x10aux::ref<x10::io::ReaderIterator<x10aux::ref<x10::lang::String> > >
      lines();
    virtual x10aux::ref<x10::io::ReaderIterator<x10_char> >
      chars();
    virtual x10aux::ref<x10::io::ReaderIterator<x10_byte> >
      bytes();
    virtual x10aux::ref<x10::io::Reader> x10__io__Reader____x10__io__Reader__this(
      );
    void _constructor();
    
    
    // Serialization
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};

} } 
#endif // X10_IO_READER_H

namespace x10 { namespace io { 
class Reader;
} } 

#ifndef X10_IO_READER_H_NODEPS
#define X10_IO_READER_H_NODEPS
#include <x10/lang/Object.h>
#include <x10/lang/Byte.h>
#include <x10/lang/Int.h>
#include <x10/lang/Boolean.h>
#include <x10/io/Marshal__BooleanMarshal.h>
#include <x10/io/Marshal.h>
#include <x10/io/Marshal__ByteMarshal.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/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/String.h>
#include <x10/io/Marshal__LineMarshal.h>
#include <x10/array/Array.h>
#include <x10/io/ReaderIterator.h>
#ifndef X10_IO_READER_H_GENERICS
#define X10_IO_READER_H_GENERICS
#ifndef X10_IO_READER_H_read_958
#define X10_IO_READER_H_read_958
template<class TPMGL(T)> TPMGL(T) x10::io::Reader::read(x10aux::ref<x10::io::Marshal<TPMGL(T)> > m) {
    
    //#line 121 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/io/Reader.x10": x10.ast.X10Return_c
    return x10::io::Marshal<TPMGL(T)>::read(x10aux::nullCheck(m), ((x10aux::ref<x10::io::Reader>)this));
    
}
#endif // X10_IO_READER_H_read_958
#ifndef X10_IO_READER_H_read_959
#define X10_IO_READER_H_read_959
template<class TPMGL(T)> void x10::io::Reader::read(x10aux::ref<x10::io::Marshal<TPMGL(T)> > m,
                                                    x10aux::ref<x10::array::Array<TPMGL(T)> > a) {
    
    //#line 128 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/io/Reader.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::io::Reader>)this)->template read<TPMGL(T) >(
      m, a, ((x10_int)0), x10aux::nullCheck(a)->FMGL(size));
}
#endif // X10_IO_READER_H_read_959
#ifndef X10_IO_READER_H_read_960
#define X10_IO_READER_H_read_960
template<class TPMGL(T)> void x10::io::Reader::read(x10aux::ref<x10::io::Marshal<TPMGL(T)> > m,
                                                    x10aux::ref<x10::array::Array<TPMGL(T)> > a,
                                                    x10_int off,
                                                    x10_int len) {
    
    //#line 136 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/io/Reader.x10": polyglot.ast.For_c
    {
        x10_int i;
        for (
             //#line 136 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/io/Reader.x10": x10.ast.X10LocalDecl_c
             i = off; ((i) < (((x10_int) ((off) + (len)))));
             
             //#line 136 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/io/Reader.x10": Eval of x10.ast.X10LocalAssign_c
             i = ((x10_int) ((i) + (((x10_int)1))))) {
            
            //#line 137 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/io/Reader.x10": Eval of x10.ast.X10Call_c
            x10aux::nullCheck(a)->x10::array::Array<TPMGL(T)>::__set(
              i, ((x10aux::ref<x10::io::Reader>)this)->template read<TPMGL(T) >(
                   m));
        }
    }
    
}
#endif // X10_IO_READER_H_read_960
#endif // X10_IO_READER_H_GENERICS
#endif // __X10_IO_READER_H_NODEPS
