#ifndef __X10_UTIL_WORKERLOCALSTORAGE_H
#define __X10_UTIL_WORKERLOCALSTORAGE_H

#include <x10rt.h>


#define X10_LANG_OBJECT_H_NODEPS
#include <x10/lang/Object.h>
#undef X10_LANG_OBJECT_H_NODEPS
#define X10_LANG_PLACELOCALHANDLE_H_NODEPS
#include <x10/lang/PlaceLocalHandle.h>
#undef X10_LANG_PLACELOCALHANDLE_H_NODEPS
namespace x10 { namespace lang { 
template<class TPMGL(T)> class PlaceLocalHandle;
} } 
namespace x10 { namespace array { 
template<class TPMGL(T)> class Array;
} } 
namespace x10 { namespace util { 
template<class TPMGL(K), class TPMGL(V)> class HashMap;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T)> class Box;
} } 
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace lang { 
class Runtime;
} } 
namespace x10 { namespace util { 
class NoSuchElementException;
} } 
namespace x10 { namespace array { 
class Dist;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(U)> class Fun_0_0;
} } 
namespace x10 { namespace util { 

template<class TPMGL(Key), class TPMGL(Value)> class WorkerLocalStorage;
template <> class WorkerLocalStorage<void, void>;
template<class TPMGL(Key), class TPMGL(Value)> class WorkerLocalStorage : public x10::lang::Object
  {
    public:
    RTT_H_DECLS_CLASS
    
    x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >
      FMGL(store);
    
    virtual x10aux::ref<x10::util::Box<TPMGL(Value)> > get(
      TPMGL(Key) key);
    virtual TPMGL(Value) getOrElse(TPMGL(Key) key, TPMGL(Value) value);
    virtual TPMGL(Value) getOrThrow(TPMGL(Key) key);
    virtual x10aux::ref<x10::util::Box<TPMGL(Value)> > put(
      TPMGL(Key) key, TPMGL(Value) value);
    virtual x10aux::ref<x10::util::Box<TPMGL(Value)> > remove(
      TPMGL(Key) key);
    virtual x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >
      x10__util__WorkerLocalStorage____x10__util__WorkerLocalStorage__this(
      );
    void _constructor();
    
    static x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> > _make(
             );
    
    void __fieldInitializers50780();
    
    // Serialization
    public: static const x10aux::serialization_id_t _serialization_id;
    
    public: virtual 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 WorkerLocalStorage<void, void> : public x10::lang::Object
{
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    
};

} } 
#endif // X10_UTIL_WORKERLOCALSTORAGE_H

namespace x10 { namespace util { 
template<class TPMGL(Key), class TPMGL(Value)> class WorkerLocalStorage;
} } 

#ifndef X10_UTIL_WORKERLOCALSTORAGE_H_NODEPS
#define X10_UTIL_WORKERLOCALSTORAGE_H_NODEPS
#include <x10/lang/Object.h>
#include <x10/lang/PlaceLocalHandle.h>
#include <x10/array/Array.h>
#include <x10/util/HashMap.h>
#include <x10/util/Box.h>
#include <x10/lang/Int.h>
#include <x10/lang/Runtime.h>
#include <x10/util/NoSuchElementException.h>
#include <x10/array/Dist.h>
#include <x10/lang/Fun_0_0.h>
#ifndef X10_UTIL_WORKERLOCALSTORAGE_H_GENERICS
#define X10_UTIL_WORKERLOCALSTORAGE_H_GENERICS
#endif // X10_UTIL_WORKERLOCALSTORAGE_H_GENERICS
#ifndef X10_UTIL_WORKERLOCALSTORAGE_H_IMPLEMENTATION
#define X10_UTIL_WORKERLOCALSTORAGE_H_IMPLEMENTATION
#include <x10/util/WorkerLocalStorage.h>

#ifndef X10_UTIL_WORKERLOCALSTORAGE__CLOSURE__1_CLOSURE
#define X10_UTIL_WORKERLOCALSTORAGE__CLOSURE__1_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_0.h>
template<class TPMGL(Key), class TPMGL(Value)> class x10_util_WorkerLocalStorage__closure__1 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_0<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >::template itable <x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > __apply() {
        
        //#line 39 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
        return x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::_make(x10::lang::Runtime::
                                                                                                       FMGL(MAX_THREADS),
                                                                                                     x10aux::class_cast_unchecked<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >(X10_NULL));
        
    }
    
    // captured environment
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >* storage = x10aux::alloc<x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) > >();
        buf.record_reference(x10aux::ref<x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) > >(storage));
        x10aux::ref<x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) > > this_ = new (storage) x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >();
        return this_;
    }
    
    x10_util_WorkerLocalStorage__closure__1() { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > > >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > > >(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10:39";
    }

};

template<class TPMGL(Key), class TPMGL(Value)> typename x10::lang::Fun_0_0<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >::template itable <x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) > >x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >::__apply, &x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(Key), class TPMGL(Value)> x10aux::itable_entry x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Fun_0_0<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > > >, &x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(Key), class TPMGL(Value)> const x10aux::serialization_id_t x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_NOT_ASYNC);

#endif // X10_UTIL_WORKERLOCALSTORAGE__CLOSURE__1_CLOSURE

//#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10FieldDecl_c

//#line 41 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(Key), class TPMGL(Value)> x10aux::ref<x10::util::Box<TPMGL(Value)> >
  x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::get(TPMGL(Key) key) {
    
    //#line 42 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10_int id = x10::lang::Runtime::workerId();
    
    //#line 43 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > localStore =
      ((x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >)this)->
        FMGL(store)->x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >::__apply();
    
    //#line 44 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(X10_NULL, localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                                           id)))) {
        
        //#line 44 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
        return X10_NULL;
        
    }
    
    //#line 45 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                               id))->get(key);
    
}

//#line 48 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(Key), class TPMGL(Value)> TPMGL(Value)
  x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::getOrElse(
  TPMGL(Key) key, TPMGL(Value) value) {
    
    //#line 49 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10_int id = x10::lang::Runtime::workerId();
    
    //#line 50 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > localStore =
      ((x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >)this)->
        FMGL(store)->x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >::__apply();
    
    //#line 51 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(X10_NULL, localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                                           id)))) {
        
        //#line 51 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
        return value;
        
    }
    
    //#line 52 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                               id))->getOrElse(key, value);
    
}

//#line 55 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(Key), class TPMGL(Value)> TPMGL(Value)
  x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::getOrThrow(
  TPMGL(Key) key) {
    
    //#line 56 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10_int id = x10::lang::Runtime::workerId();
    
    //#line 57 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > localStore =
      ((x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >)this)->
        FMGL(store)->x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >::__apply();
    
    //#line 58 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(X10_NULL, localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                                           id)))) {
        
        //#line 58 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": polyglot.ast.Throw_c
        x10aux::throwException(x10aux::nullCheck(x10::util::NoSuchElementException::_make(x10aux::string_utils::lit("Not found"))));
    }
    
    //#line 59 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                               id))->getOrThrow(key);
    
}

//#line 62 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(Key), class TPMGL(Value)> x10aux::ref<x10::util::Box<TPMGL(Value)> >
  x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::put(
  TPMGL(Key) key, TPMGL(Value) value) {
    
    //#line 63 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10_int id = x10::lang::Runtime::workerId();
    
    //#line 64 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > localStore =
      ((x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >)this)->
        FMGL(store)->x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >::__apply();
    
    //#line 65 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(X10_NULL, localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                                           id)))) {
        
        //#line 65 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": Eval of x10.ast.X10Call_c
        localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__set(
          id, x10::util::HashMap<TPMGL(Key), TPMGL(Value)>::_make());
    }
    
    //#line 66 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                               id))->put(key, value);
    
}

//#line 69 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(Key), class TPMGL(Value)> x10aux::ref<x10::util::Box<TPMGL(Value)> >
  x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::remove(
  TPMGL(Key) key) {
    
    //#line 70 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10_int id = x10::lang::Runtime::workerId();
    
    //#line 71 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10LocalDecl_c
    x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > localStore =
      ((x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >)this)->
        FMGL(store)->x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >::__apply();
    
    //#line 72 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10If_c
    if ((x10aux::struct_equals(X10_NULL, localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                                           id)))) {
        
        //#line 72 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
        return X10_NULL;
        
    }
    
    //#line 73 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
    return x10aux::nullCheck(localStore->x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > >::__apply(
                               id))->remove(key);
    
}

//#line 37 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(Key), class TPMGL(Value)> x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >
  x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::x10__util__WorkerLocalStorage____x10__util__WorkerLocalStorage__this(
  ) {
    
    //#line 37 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >)this);
    
}

//#line 37 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(Key), class TPMGL(Value)> void x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::_constructor(
                                                 ) {
    
    //#line 37 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::lang::Object::_constructor();
    
    //#line 37 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.AssignPropertyCall_c
    
    //#line 37 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >)this)->x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::__fieldInitializers50780();
}
template<class TPMGL(Key), class TPMGL(Value)> x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> > x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::_make(
                                                 ) {
    x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> > this_ = new (memset(x10aux::alloc<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >(), 0, sizeof(x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>))) x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>();
    this_->_constructor();
    return this_;
}



//#line 37 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(Key), class TPMGL(Value)> void x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::__fieldInitializers50780(
  ) {
    
    //#line 37 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/WorkerLocalStorage.x10": Eval of x10.ast.X10FieldAssign_c
    ((x10aux::ref<x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)> >)this)->
      FMGL(store) = x10::lang::PlaceLocalHandle<void>::template make<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > >(
                      x10::array::Dist::makeUnique(), x10aux::ref<x10::lang::Fun_0_0<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > > >(x10aux::ref<x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value) > >(new (x10aux::alloc<x10::lang::Fun_0_0<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > > >(sizeof(x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value)>)))x10_util_WorkerLocalStorage__closure__1<TPMGL(Key),TPMGL(Value)>())));
}
template<class TPMGL(Key), class TPMGL(Value)> const x10aux::serialization_id_t x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::_deserializer, x10aux::CLOSURE_KIND_NOT_ASYNC);

template<class TPMGL(Key), class TPMGL(Value)> void x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::_serialize_body(x10aux::serialization_buffer& buf) {
    x10::lang::Object::_serialize_body(buf);
    buf.write(this->FMGL(store));
    
}

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

template<class TPMGL(Key), class TPMGL(Value)> void x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::_deserialize_body(x10aux::deserialization_buffer& buf) {
    x10::lang::Object::_deserialize_body(buf);
    FMGL(store) = buf.read<x10::lang::PlaceLocalHandle<x10aux::ref<x10::array::Array<x10aux::ref<x10::util::HashMap<TPMGL(Key), TPMGL(Value)> > > > > >();
}

template<class TPMGL(Key), class TPMGL(Value)> x10aux::RuntimeType x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::rtt;
template<class TPMGL(Key), class TPMGL(Value)> void x10::util::WorkerLocalStorage<TPMGL(Key), TPMGL(Value)>::_initRTT() {
    const x10aux::RuntimeType *canonical = x10aux::getRTT<x10::util::WorkerLocalStorage<void, void> >();
    if (rtt.initStageOne(canonical)) return;
    const x10aux::RuntimeType* parents[1] = { x10aux::getRTT<x10::lang::Object>()};
    const x10aux::RuntimeType* params[2] = { x10aux::getRTT<TPMGL(Key)>(), x10aux::getRTT<TPMGL(Value)>()};
    x10aux::RuntimeType::Variance variances[2] = { x10aux::RuntimeType::invariant, x10aux::RuntimeType::invariant};
    const char *baseName = "x10.util.WorkerLocalStorage";
    rtt.initStageTwo(baseName, x10aux::RuntimeType::class_kind, 1, parents, 2, params, variances);
}
#endif // X10_UTIL_WORKERLOCALSTORAGE_H_IMPLEMENTATION
#endif // __X10_UTIL_WORKERLOCALSTORAGE_H_NODEPS
