#ifndef _DECL_NborBaseLB_H_
#define _DECL_NborBaseLB_H_
#include "charm++.h"
#include "LBDatabase.decl.h"

/* DECLS: readonly CkGroupID nborBaselb;
 */

/* DECLS: message NLBStatsMsg;
 */
class NLBStatsMsg;
class CMessage_NLBStatsMsg: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_NLBStatsMsg() {};
    static void *pack(NLBStatsMsg *p);
    static NLBStatsMsg* 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 NLBMigrateMsg;
 */
class NLBMigrateMsg;
class CMessage_NLBMigrateMsg: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_NLBMigrateMsg() {};
    static void *pack(NLBMigrateMsg *p);
    static NLBMigrateMsg* 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 NborBaseLB{
void NborBaseLB(void);
void ReceiveStats(NLBStatsMsg*);
void ResumeClients(void);
void ReceiveMigration(NLBMigrateMsg*);
};
 */
class NborBaseLB;
class CProxy_NborBaseLB:  public virtual _CK_GID{
  public:
    static int __idx;
    static void __register(const char *s, size_t size);
    CProxy_NborBaseLB(CkGroupID _gid) { _ck_gid = _gid; _setChare(0); }
    CProxy_NborBaseLB(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);}
    NborBaseLB* ckLocalBranch(void) {
      return (NborBaseLB *) CkLocalBranch(_ck_gid);
    }
    static NborBaseLB* ckLocalBranch(CkGroupID gID) {
      return (NborBaseLB *) CkLocalBranch(gID);
    }
/* DECLS: void NborBaseLB(void);
 */
    static CkGroupID ckNew(void);
    static CkGroupID ckNewSync(void);
    CProxy_NborBaseLB(int retEP, CkChareID *cid);
    CProxy_NborBaseLB(void);
    static int  __idx_NborBaseLB_void;
    static int  ckIdx_NborBaseLB(void) { return __idx_NborBaseLB_void; }
    static void _call_NborBaseLB_void(void* msg, NborBaseLB* obj);

/* DECLS: void ReceiveStats(NLBStatsMsg*);
 */
    void ReceiveStats(NLBStatsMsg*msg){
      if(_isChare())
        CkSendMsg(__idx_ReceiveStats_NLBStatsMsg, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_ReceiveStats_NLBStatsMsg, msg, _ck_gid);
    }
    void ReceiveStats(NLBStatsMsg*msg, int onPE) {
      CkSendMsgBranch(__idx_ReceiveStats_NLBStatsMsg, msg, onPE, _ck_gid);
    }
    void ReceiveStats(NLBStatsMsg*msg, int npes, int *pes) {
      CkSendMsgBranchMulti(__idx_ReceiveStats_NLBStatsMsg, msg, npes, pes, _ck_gid);
    }
    static int  __idx_ReceiveStats_NLBStatsMsg;
    static int  ckIdx_ReceiveStats(NLBStatsMsg*msg) { return __idx_ReceiveStats_NLBStatsMsg; }
    static void _call_ReceiveStats_NLBStatsMsg(void* msg, NborBaseLB* obj);

/* DECLS: void ResumeClients(void);
 */
    void ResumeClients(void){
      void *msg = CkAllocSysMsg();
      if(_isChare())
        CkSendMsg(__idx_ResumeClients_void, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_ResumeClients_void, msg, _ck_gid);
    }
    void ResumeClients(int onPE) {
      void *msg = CkAllocSysMsg();
      CkSendMsgBranch(__idx_ResumeClients_void, msg, onPE, _ck_gid);
    }
    void ResumeClients(int npes, int *pes) {
      void *msg = CkAllocSysMsg();
      CkSendMsgBranchMulti(__idx_ResumeClients_void, msg, npes, pes, _ck_gid);
    }
    static int  __idx_ResumeClients_void;
    static int  ckIdx_ResumeClients(void) { return __idx_ResumeClients_void; }
    static void _call_ResumeClients_void(void* msg, NborBaseLB* obj);

/* DECLS: void ReceiveMigration(NLBMigrateMsg*);
 */
    void ReceiveMigration(NLBMigrateMsg*msg){
      if(_isChare())
        CkSendMsg(__idx_ReceiveMigration_NLBMigrateMsg, msg, &_ck_cid);
      else
        CkBroadcastMsgBranch(__idx_ReceiveMigration_NLBMigrateMsg, msg, _ck_gid);
    }
    void ReceiveMigration(NLBMigrateMsg*msg, int onPE) {
      CkSendMsgBranch(__idx_ReceiveMigration_NLBMigrateMsg, msg, onPE, _ck_gid);
    }
    void ReceiveMigration(NLBMigrateMsg*msg, int npes, int *pes) {
      CkSendMsgBranchMulti(__idx_ReceiveMigration_NLBMigrateMsg, msg, npes, pes, _ck_gid);
    }
    static int  __idx_ReceiveMigration_NLBMigrateMsg;
    static int  ckIdx_ReceiveMigration(NLBMigrateMsg*msg) { return __idx_ReceiveMigration_NLBMigrateMsg; }
    static void _call_ReceiveMigration_NLBMigrateMsg(void* msg, NborBaseLB* obj);
};

extern void _registerNborBaseLB(void);
#endif
