#ifndef _DECL_BlueGene_H_
#define _DECL_BlueGene_H_
#include "charm++.h"
/* DECLS: readonly CkChareID mainID;
 */

/* DECLS: readonly CkArrayID bgArrayID;
 */

/* DECLS: message CreateBgNodeMsg;
 */
class CreateBgNodeMsg;
class CMessage_CreateBgNodeMsg:public CkArrayMessage{
  public:
    static int __idx;
    void* operator new(size_t, const int);
    void* operator new(size_t);
    void operator delete(void *p){CkFreeMsg(p);}
    void* operator new(size_t, void*p) {return p;}
    void* operator new(size_t, int*, const int);
    void* operator new(size_t, int*);
    static void*alloc(int,size_t,int*,int);
    CMessage_CreateBgNodeMsg() {};
    static void *pack(CreateBgNodeMsg *p);
    static CreateBgNodeMsg* unpack(void* p);
    static void __register(const char *s, size_t size, CkPackFnPtr pack, CkUnpackFnPtr unpack) {
      __idx = CkRegisterMsg(s, pack, unpack, 0, size);
    }
};

/* DECLS: message PacketMsg;
 */
class PacketMsg;
class CMessage_PacketMsg:public CkArrayMessage{
  public:
    static int __idx;
    void* operator new(size_t, const int);
    void* operator new(size_t);
    void operator delete(void *p){CkFreeMsg(p);}
    void* operator new(size_t, void*p) {return p;}
    void* operator new(size_t, int*, const int);
    void* operator new(size_t, int*);
    static void*alloc(int,size_t,int*,int);
    CMessage_PacketMsg() {};
    static void *pack(PacketMsg *p);
    static PacketMsg* unpack(void* p);
    static void __register(const char *s, size_t size, CkPackFnPtr pack, CkUnpackFnPtr unpack) {
      __idx = CkRegisterMsg(s, pack, unpack, 0, size);
    }
};

/* DECLS: mainchare Main{
Main();
void Finish(void);
};
 */
class Main;
class CProxy_Main: public virtual _CK_CID{
  public:
    static int __idx;
    static void __register(const char *s, size_t size);
    CProxy_Main(CkChareID __cid) { ckSetChareId(__cid); }
    CkChareID ckGetChareId(void) { return _ck_cid; }
    void ckSetChareId(CkChareID __cid) {_CHECK_CID(__cid,__idx);_ck_cid=__cid;}
/* DECLS: Main();
 */
    static void ckNew(int onPE=CK_PE_ANY);
    static void ckNew(CkChareID* pcid, int onPE=CK_PE_ANY);
    CProxy_Main(int onPE=CK_PE_ANY);
    static int  __idx_Main;
    static int  ckIdx_Main() { return __idx_Main; }
    static void _call_Main(CkArgMsg* msg, Main* obj);

/* DECLS: void Finish(void);
 */
    void Finish(void);
    static int  __idx_Finish_void;
    static int  ckIdx_Finish(void) { return __idx_Finish_void; }
    static void _call_Finish_void(void* msg, Main* obj);
};

/* DECLS: array BgNode: ArrayElement{
BgNode(CkMigrateMessage*);
BgNode(CreateBgNodeMsg*);
void putMessage(PacketMsg*);
};
 */
class BgNode;
class CProxy_BgNode : public CProxy_ArrayElement{
  public:
    static int __idx;
    static void __register(const char *s, size_t size);
    static CkGroupID buildArrayGroup(CkGroupID mapID=_RRMapID,int numInitial=0)
    {
        return CkArray::CreateArray(mapID,numInitial);
    }
  protected:
    CProxy_BgNode(const CkArrayID &aid,const CkArrayIndex3D &idx)
        :CProxy_ArrayElement(aid,idx) {}
  public:
    CProxy_BgNode(const CkArrayID &aid) 
        :CProxy_ArrayElement(aid) {}
    CProxy_BgNode(void) {}
    static CkArrayID ckNew(void) {return CkArrayID(buildArrayGroup());}
    static CkArrayID ckNew_mapped(CkGroupID mapID) {return CkArrayID(buildArrayGroup(mapID));}
//Generalized array indexing: (these KEEP the index you pass in!)
    CProxy_BgNode operator [] (const CkArrayIndex3D &idx) const
        {return CProxy_BgNode(_aid, idx);}
    CProxy_BgNode operator() (const CkArrayIndex3D &idx) const
        {return CProxy_BgNode(_aid, idx);}
    CProxy_BgNode operator () (int i0,int i1,int i2) const 
        {return CProxy_BgNode(_aid, CkArrayIndex3D(i0,i1,i2));}
/* DECLS: BgNode(CkMigrateMessage*);
 */
    static int  __idx_BgNode_CkMigrateMessage;
    static int  ckIdx_BgNode(CkMigrateMessage*msg) { return __idx_BgNode_CkMigrateMessage; }
    static void _call_BgNode_CkMigrateMessage(void* msg, BgNode* obj);

/* DECLS: BgNode(CreateBgNodeMsg*);
 */
    void insert(CreateBgNodeMsg*msg, int onPE=-1);    static int  __idx_BgNode_CreateBgNodeMsg;
    static int  ckIdx_BgNode(CreateBgNodeMsg*msg) { return __idx_BgNode_CreateBgNodeMsg; }
    static void _call_BgNode_CreateBgNodeMsg(void* msg, BgNode* obj);

/* DECLS: void putMessage(PacketMsg*);
 */
    void putMessage(PacketMsg*msg) const;
    static int  __idx_putMessage_PacketMsg;
    static int  ckIdx_putMessage(PacketMsg*msg) { return __idx_putMessage_PacketMsg; }
    static void _call_putMessage_PacketMsg(void* msg, BgNode* obj);
};

extern void _registerBlueGene(void);
extern "C" void CkRegisterMainModule(void);
#endif
