00001 00005 00006 #ifndef LBOM_H 00007 #define LBOM_H 00008 00009 #include "lbdb.h" 00010 #include "LBObj.h" 00011 00012 class LBDB; 00013 00014 class LBOM 00015 { 00016 friend class LBDB; 00017 00018 public: 00019 LDOMid id() { return myid; }; 00020 00021 void *getUserData() { return userData; } 00022 00023 private: 00024 LBOM() { }; 00025 00026 LBOM(LBDB *_parent, LDOMid _id, 00027 void *_userData, LDCallbacks _callbacks) { 00028 parent = _parent; 00029 myid = _id; 00030 userData = _userData; 00031 callbacks = _callbacks; 00032 registering_objs = false; 00033 }; 00034 ~LBOM() { } 00035 00036 void DepositHandle(LDOMHandle _h) { myhandle = _h; }; 00037 void Migrate(LDObjHandle _h, int dest) { callbacks.migrate(_h,dest); }; 00038 #if CMK_LBDB_ON 00039 void MetaLBResumeWaitingChares(LDObjHandle _h, int lb_ideal_period) { 00040 callbacks.metaLBResumeWaitingChares(_h, lb_ideal_period); 00041 } 00042 void MetaLBCallLBOnChares(LDObjHandle _h) { 00043 callbacks.metaLBCallLBOnChares(_h); 00044 } 00045 #endif 00046 bool RegisteringObjs() { return registering_objs; }; 00047 void SetRegisteringObjs(bool _set) { registering_objs = _set; }; 00048 00049 LBDB *parent; 00050 LDOMid myid; 00051 LDOMHandle myhandle; 00052 void *userData; 00053 LDCallbacks callbacks; 00054 bool registering_objs; 00055 00056 }; 00057 00058 #endif 00059