#ifndef __X10_LANG_FINISHSTATE__REMOTEFINISH_H
#define __X10_LANG_FINISHSTATE__REMOTEFINISH_H

#include <x10rt.h>


#define X10_LANG_FINISHSTATE__REMOTEFINISHSKELETON_H_NODEPS
#include <x10/lang/FinishState__RemoteFinishSkeleton.h>
#undef X10_LANG_FINISHSTATE__REMOTEFINISHSKELETON_H_NODEPS
#define X10_UTIL_CONCURRENT_LOCK_H_NODEPS
#include <x10/util/concurrent/Lock.h>
#undef X10_UTIL_CONCURRENT_LOCK_H_NODEPS
#define X10_LANG_INT_H_NODEPS
#include <x10/lang/Int.h>
#undef X10_LANG_INT_H_NODEPS
#define X10_UTIL_INDEXEDMEMORYCHUNK_H_NODEPS
#include <x10/util/IndexedMemoryChunk.h>
#undef X10_UTIL_INDEXEDMEMORYCHUNK_H_NODEPS
#define X10_UTIL_CONCURRENT_ATOMICINTEGER_H_NODEPS
#include <x10/util/concurrent/AtomicInteger.h>
#undef X10_UTIL_CONCURRENT_ATOMICINTEGER_H_NODEPS
namespace x10 { namespace util { 
template<class TPMGL(T)> class Stack;
} } 
namespace x10 { namespace lang { 
class Throwable;
} } 
namespace x10 { namespace compiler { 
class Embed;
} } 
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T)> class IndexedMemoryChunk;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class GlobalRef;
} } 
namespace x10 { namespace lang { 
class FinishState;
} } 
namespace x10 { namespace lang { 
class Place;
} } 
namespace x10 { namespace lang { 
class Runtime;
} } 
namespace x10 { namespace lang { 
class MultipleExceptions;
} } 
namespace x10 { namespace lang { 
class VoidFun_0_0;
} } 
namespace x10 { namespace lang { 
class FinishState__RootFinish;
} } 
namespace x10 { namespace compiler { 
class RemoteInvocation;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T), class TPMGL(U)> class Pair;
} } 
namespace x10 { namespace lang { 
class Zero;
} } 
namespace x10 { namespace lang { 

class FinishState__RemoteFinish : public x10::lang::FinishState__RemoteFinishSkeleton
  {
    public:
    RTT_H_DECLS_CLASS
    
    x10aux::ref<x10::util::Stack<x10aux::ref<x10::lang::Throwable> > >
      FMGL(exceptions);
    
    x10::util::concurrent::Lock _Embed_lock;
    x10aux::ref<x10::util::concurrent::Lock> FMGL(lock);
    
    x10_int FMGL(count);
    
    x10::util::IndexedMemoryChunk<x10_int > FMGL(counts);
    
    x10::util::IndexedMemoryChunk<x10_int > FMGL(places);
    
    x10_int FMGL(length);
    
    x10::util::concurrent::AtomicInteger _Embed_local;
    x10aux::ref<x10::util::concurrent::AtomicInteger> FMGL(local);
    
    void _constructor(x10::lang::GlobalRef<x10aux::ref<x10::lang::FinishState> > ref);
    
    static x10aux::ref<x10::lang::FinishState__RemoteFinish> _make(
             x10::lang::GlobalRef<x10aux::ref<x10::lang::FinishState> > ref);
    
    virtual void notifyActivityCreation();
    virtual void notifySubActivitySpawn(x10::lang::Place place);
    virtual void pushException(x10aux::ref<x10::lang::Throwable> t);
    virtual void notifyActivityTermination();
    virtual x10aux::ref<x10::lang::FinishState__RemoteFinish> x10__lang__FinishState__RemoteFinish____x10__lang__FinishState__RemoteFinish__this(
      );
    void __fieldInitializers43523();
    
    // 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);
    
};

} } 
#endif // X10_LANG_FINISHSTATE__REMOTEFINISH_H

namespace x10 { namespace lang { 
class FinishState__RemoteFinish;
} } 

#ifndef X10_LANG_FINISHSTATE__REMOTEFINISH_H_NODEPS
#define X10_LANG_FINISHSTATE__REMOTEFINISH_H_NODEPS
#ifndef X10_LANG_FINISHSTATE__REMOTEFINISH_H_GENERICS
#define X10_LANG_FINISHSTATE__REMOTEFINISH_H_GENERICS
#endif // X10_LANG_FINISHSTATE__REMOTEFINISH_H_GENERICS
#endif // __X10_LANG_FINISHSTATE__REMOTEFINISH_H_NODEPS
