
00001 00003 // 00005 // 00006 //#ifndef COMMLIBARRAYLISTENER_H 00007 //#define COMMLIBARRAYLISTENER_H 00008 // 00009 //#include "ComlibStrategy.h" 00010 // 00012 // * This class is used by the ComlibArrayInfo class to keep track of new objects 00013 // * when the user specification is so. Namely, a ComlibArrayInfo can register 00014 // * itself with this ArrayListener so that every element that for every element 00015 // * that is created on this processor, the ComlibArrayInfo class is notified and 00016 // * can take appropriate action. 00017 // */ 00018 //class ComlibArrayListener : public CkArrayListener { 00019 // //int nElements; 00020 // int setupFinished; 00021 // CkArrayID thisArrayID; 00022 // /* 00023 // CkVec <StrategyTableEntry *> strategyList; 00024 // CkHashtableT<CkArrayIndex, CkArrayIndex*> *ht; 00025 // 00026 // int isRegistered(ArrayElement *elt, CharmStrategy *astrat); 00027 // void addElement(ArrayElement *elt, CmiBool mogration_flag); 00028 // void deleteElement(ArrayElement *elt, CmiBool migration_flag); 00029 // */ 00030 // CkVec<ComlibArrayInfo*> users; 00031 // CkVec<int> userIDs; 00032 // 00033 // public: 00034 // ComlibArrayListener(CkArrayID &id); 00035 // ComlibArrayListener(CkMigrateMessage *); 00036 // 00037 // inline bool operator==(CkArrayID &a) { 00038 // return (thisArrayID == a); 00039 // } 00040 // 00041 // inline bool operator==(ComlibArrayListener &l) { 00042 // return operator==(l.thisArrayID); 00043 // } 00044 // 00045 // inline void registerUser(ComlibArrayInfo *ai, int stratid=0) { 00046 // users.push_back(ai); 00047 // userIDs.push_back(stratid); 00048 // } 00049 // 00050 // void ckEndInserting(); 00051 // 00052 // void ckElementCreating(ArrayElement *elt); 00053 // //void ckElementDied(ArrayElement *elt); 00054 // 00055 // //void ckElementLeaving(ArrayElement *elt); 00056 // //CmiBool ckElementArriving(ArrayElement *elt); 00057 // 00058 // //Add strategy to listening list, strategy will get an the number 00059 // //of array elements lying on that processor 00060 // //void registerStrategy(StrategyTableEntry *); 00061 // 00062 // //remove strategy from table, and now it will not get updates 00063 // //about this array 00064 // /* 00065 // void unregisterStrategy(StrategyTableEntry *entry) { 00066 // for(int count = 0; count < strategyList.size(); count++) 00067 // if(strategyList[count] == entry) 00068 // strategyList.remove(count); 00069 // } 00070 // 00071 // void getLocalIndices(CkVec<CkArrayIndex> &vec); 00072 // */ 00073 // 00074 // void pup(PUP::er &p); 00075 // PUPable_decl(ComlibArrayListener); 00076 //}; 00077 // 00078 //#endif 00079 //
1.5.5