#ifndef _DECL_CkFutures_H_
#define _DECL_CkFutures_H_
#include "charm++.h"
/* DECLS: message CkQdMsg;
 */
class CkQdMsg;
class CMessage_CkQdMsg: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_CkQdMsg() {};
    static void *pack(CkQdMsg *p);
    static CkQdMsg* 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 FutureInitMsg;
 */
class FutureInitMsg;
class CMessage_FutureInitMsg: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_FutureInitMsg() {};
    static void *pack(FutureInitMsg *p);
    static FutureInitMsg* unpack(void* p);
    static void __register(const char *s, size_t size, CkPackFnPtr pack, CkUnpackFnPtr unpack) {
      __idx = CkRegisterMsg(s, pack, unpack, 0, size);
    }
};

/* DECLS: group FutureBOC{
FutureBOC(FutureInitMsg*);
void SetFuture(FutureInitMsg*);
};
 */
class FutureBOC;
class CProxy_FutureBOC:  public virtual _CK_GID{
  public:
    static int __idx;
    static void __register(const char *s, size_t size);
    CProxy_FutureBOC(CkGroupID _gid) { _ck_gid = _gid; _setChare(0); }
    CProxy_FutureBOC(CkChareID __cid) { ckSetChareId(__cid); }
    CkChareID ckGetChareId(void) { return _ck_cid; }
    void ckSetChareId(CkChareID __cid){_CHECK_CID(__cid,__idx);_ck_cid=__cid;_setChare(1);}
    CkGroupID ckGetGroupId(void) { return _ck_gid; }
    void ckSetGroupId(CkGroupID _gid){_ck_gid=_gid;_setChare(0);}
    FutureBOC* ckLocalBranch(void) {
      return (FutureBOC *) CkLocalBranch(_ck_gid);
    }
    static FutureBOC* ckLocalBranch(CkGroupID gID) {
      return (FutureBOC *) CkLocalBranch(gID);
    }
/* DECLS: FutureBOC(FutureInitMsg*);
 */
    static CkGroupID ckNew(FutureInitMsg*msg);
    static CkGroupID ckNewSync(FutureInitMsg*msg);
    CProxy_FutureBOC(FutureInitMsg*msg, int retEP, CkChareID *cid);
    CProxy_FutureBOC(FutureInitMsg*msg);
    static int  __idx_FutureBOC_FutureInitMsg;
    static int  ckIdx_FutureBOC(FutureInitMsg*msg) { return __idx_FutureBOC_FutureInitMsg; }
    static void _call_FutureBOC_FutureInitMsg(void* msg, FutureBOC* obj);

/* DECLS: void SetFuture(FutureInitMsg*);
 */
    void SetFuture(FutureInitMsg*msg){
      if(_isChare())
        CkSendMsg(__idx_SetFuture_FutureInitMsg, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_SetFuture_FutureInitMsg, msg, _ck_gid);
    }
    void SetFuture(FutureInitMsg*msg, int onPE) {
      CkSendMsgBranch(__idx_SetFuture_FutureInitMsg, msg, onPE, _ck_gid);
    }
    void SetFuture(FutureInitMsg*msg, int npes, int *pes) {
      CkSendMsgBranchMulti(__idx_SetFuture_FutureInitMsg, msg, npes, pes, _ck_gid);
    }
    static int  __idx_SetFuture_FutureInitMsg;
    static int  ckIdx_SetFuture(FutureInitMsg*msg) { return __idx_SetFuture_FutureInitMsg; }
    static void _call_SetFuture_FutureInitMsg(void* msg, FutureBOC* obj);
};

/* DECLS: mainchare FutureMain{
FutureMain();
};
 */
class FutureMain;
class CProxy_FutureMain: public virtual _CK_CID{
  public:
    static int __idx;
    static void __register(const char *s, size_t size);
    CProxy_FutureMain(CkChareID __cid) { ckSetChareId(__cid); }
    CkChareID ckGetChareId(void) { return _ck_cid; }
    void ckSetChareId(CkChareID __cid) {_CHECK_CID(__cid,__idx);_ck_cid=__cid;}
/* DECLS: FutureMain();
 */
    static void ckNew(int onPE=CK_PE_ANY);
    static void ckNew(CkChareID* pcid, int onPE=CK_PE_ANY);
    CProxy_FutureMain(int onPE=CK_PE_ANY);
    static int  __idx_FutureMain;
    static int  ckIdx_FutureMain() { return __idx_FutureMain; }
    static void _call_FutureMain(CkArgMsg* msg, FutureMain* obj);
};

/* DECLS: readonly CkGroupID _fbocID;
 */

extern void _registerCkFutures(void);
#endif
