#ifndef __X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H
#define __X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H

#include <x10rt.h>


#define X10_LANG_OBJECT_H_NODEPS
#include <x10/lang/Object.h>
#undef X10_LANG_OBJECT_H_NODEPS
#define X10_LANG_REDUCIBLE_H_NODEPS
#include <x10/lang/Reducible.h>
#undef X10_LANG_REDUCIBLE_H_NODEPS
namespace x10 { namespace array { 
template<class TPMGL(T)> class DistArray;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(Z1), class TPMGL(Z2), class TPMGL(U)> class Fun_0_2;
} } 
namespace x10 { namespace array { 

template<class TPMGL(U), class TPMGL(T34107)> class DistArray__Anonymous__27239;
template <> class DistArray__Anonymous__27239<void, void>;
template<class TPMGL(U), class TPMGL(T34107)> class DistArray__Anonymous__27239 : public x10::lang::Object
  {
    public:
    RTT_H_DECLS_CLASS
    
    static x10aux::itable_entry _itables[3];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    static typename x10::lang::Reducible<TPMGL(U)>::template itable<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> > _itable_0;
    
    static x10::lang::Any::itable<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> > _itable_1;
    
    x10aux::ref<x10::array::DistArray<TPMGL(T34107)> > FMGL(out__);
    
    TPMGL(U) FMGL(unit);
    
    x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)> >
      FMGL(gop);
    
    virtual TPMGL(U) zero();
    virtual TPMGL(U) __apply(TPMGL(U) a, TPMGL(U) b);
    void _constructor(x10aux::ref<x10::array::DistArray<TPMGL(T34107)> > out__,
                      TPMGL(U) unit, x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)> > gop);
    
    static x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> > _make(
             x10aux::ref<x10::array::DistArray<TPMGL(T34107)> > out__,
             TPMGL(U) unit, x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)> > gop);
    
    
    // Serialization
    public: static const x10aux::serialization_id_t _serialization_id;
    
    public: x10aux::serialization_id_t _get_serialization_id() {
         return _serialization_id;
    }
    
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: static x10aux::ref<x10::lang::Reference> _deserializer(x10aux::deserialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};
template <> class DistArray__Anonymous__27239<void, void> : public x10::lang::Object
{
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    
};

} } 
#endif // X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H

namespace x10 { namespace array { 
template<class TPMGL(U), class TPMGL(T34107)> class DistArray__Anonymous__27239;
} } 

#ifndef X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_NODEPS
#define X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_NODEPS
#include <x10/lang/Object.h>
#include <x10/lang/Reducible.h>
#include <x10/array/DistArray.h>
#include <x10/lang/Fun_0_2.h>
#ifndef X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_GENERICS
#define X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_GENERICS
#endif // X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_GENERICS
#ifndef X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_IMPLEMENTATION
#define X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_IMPLEMENTATION
#include <x10/array/DistArray__Anonymous__27239.h>

template<class TPMGL(U), class TPMGL(T34107)> typename x10::lang::Reducible<TPMGL(U)>::template itable<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >  x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_itable_0(&x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::equals, &x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::hashCode, &x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::__apply, &x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::toString, &x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::typeName, &x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::zero);
template<class TPMGL(U), class TPMGL(T34107)> x10::lang::Any::itable<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >  x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_itable_1(&x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::equals, &x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::hashCode, &x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::toString, &x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::typeName);
template<class TPMGL(U), class TPMGL(T34107)> x10aux::itable_entry x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_itables[3] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Reducible<TPMGL(U)> >, &_itable_0), x10aux::itable_entry(&x10aux::getRTT<x10::lang::Any>, &_itable_1), x10aux::itable_entry(NULL, (void*)x10aux::getRTT<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >())};

//#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10FieldDecl_c

//#line 685 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10FieldDecl_c

//#line 685 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10FieldDecl_c

//#line 687 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(U), class TPMGL(T34107)> TPMGL(U) x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::zero(
  ) {
    
    //#line 687 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(((x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >)this))->
             FMGL(unit);
    
}

//#line 688 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(U), class TPMGL(T34107)> TPMGL(U) x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::__apply(
  TPMGL(U) a, TPMGL(U) b) {
    
    //#line 688 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10Return_c
    return x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)>::__apply(x10aux::nullCheck(x10aux::nullCheck(((x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >)this))->
                                                                                         FMGL(gop)), 
      a, b);
    
}

//#line 686 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(U), class TPMGL(T34107)> void x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_constructor(
                                                x10aux::ref<x10::array::DistArray<TPMGL(T34107)> > out__,
                                                TPMGL(U) unit,
                                                x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)> > gop) {
    
    //#line 686 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 46 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >)this)->
      FMGL(out__) = out__;
    
    //#line 685 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >)this)->
      FMGL(unit) = unit;
    
    //#line 685 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/array/DistArray.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >)this)->
      FMGL(gop) = gop;
}
template<class TPMGL(U), class TPMGL(T34107)> x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> > x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_make(
                                                x10aux::ref<x10::array::DistArray<TPMGL(T34107)> > out__,
                                                TPMGL(U) unit,
                                                x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)> > gop)
{
    x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> > this_ = new (memset(x10aux::alloc<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >(), 0, sizeof(x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>))) x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>();
    this_->_constructor(out__, unit, gop);
    return this_;
}


template<class TPMGL(U), class TPMGL(T34107)> const x10aux::serialization_id_t x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_deserializer, x10aux::CLOSURE_KIND_NOT_ASYNC);

template<class TPMGL(U), class TPMGL(T34107)> void x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_serialize_body(x10aux::serialization_buffer& buf) {
    x10::lang::Object::_serialize_body(buf);
    buf.write(this->FMGL(unit));
    buf.write(this->FMGL(gop));
    buf.write(this->FMGL(out__));
    
}

template<class TPMGL(U), class TPMGL(T34107)> x10aux::ref<x10::lang::Reference> x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_deserializer(x10aux::deserialization_buffer& buf) {
    x10aux::ref<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> > this_ = new (memset(x10aux::alloc<x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)> >(), 0, sizeof(x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>))) x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>();
    buf.record_reference(this_);
    this_->_deserialize_body(buf);
    return this_;
}

template<class TPMGL(U), class TPMGL(T34107)> void x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_deserialize_body(x10aux::deserialization_buffer& buf) {
    x10::lang::Object::_deserialize_body(buf);
    FMGL(unit) = buf.read<TPMGL(U)>();
    FMGL(gop) = buf.read<x10aux::ref<x10::lang::Fun_0_2<TPMGL(U), TPMGL(U), TPMGL(U)> > >();
    FMGL(out__) = buf.read<x10aux::ref<x10::array::DistArray<TPMGL(T34107)> > >();
}

template<class TPMGL(U), class TPMGL(T34107)> x10aux::RuntimeType x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::rtt;
template<class TPMGL(U), class TPMGL(T34107)> void x10::array::DistArray__Anonymous__27239<TPMGL(U), TPMGL(T34107)>::_initRTT() {
    const x10aux::RuntimeType *canonical = x10aux::getRTT<x10::array::DistArray__Anonymous__27239<void, void> >();
    if (rtt.initStageOne(canonical)) return;
    const x10aux::RuntimeType* parents[2] = { x10aux::getRTT<x10::lang::Object>(), x10aux::getRTT<x10::lang::Reducible<TPMGL(U)> >()};
    const x10aux::RuntimeType* params[2] = { x10aux::getRTT<TPMGL(U)>(), x10aux::getRTT<TPMGL(T34107)>()};
    x10aux::RuntimeType::Variance variances[2] = { x10aux::RuntimeType::invariant, x10aux::RuntimeType::invariant};
    const char *baseName = "x10.array.DistArray.Anonymous.27239";
    rtt.initStageTwo(baseName, x10aux::RuntimeType::class_kind, 2, parents, 2, params, variances);
}
#endif // X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_IMPLEMENTATION
#endif // __X10_ARRAY_DISTARRAY__ANONYMOUS__27239_H_NODEPS
