00001 /* 00002 Make CCS call a CkCallback instead of a flat C function. 00003 00004 Initial version by Orion Sky Lawlor, olawlor@acm.org, 2/8/2002 00005 */ 00006 #ifndef _CKCALLBACK_CCS_H_ 00007 #define _CKCALLBACK_CCS_H_ 00008 00009 #include "charm++.h" /*for CkCallback, etc.*/ 00010 #include "conv-ccs.h" /*for CcsDelayedReply struct*/ 00011 #include "CkCallback.decl.h" /*for CMessage_CkCcsRequestMsg*/ 00012 00018 class CkCcsRequestMsg : public CMessage_CkCcsRequestMsg { 00019 public: 00020 CcsDelayedReply reply; /*Object to send reply to*/ 00021 int length; //Number of bytes of request data. 00022 char *data; //Actual data sent along with request. 00023 }; 00024 00028 class CkDataMsg : public CMessage_CkDataMsg { 00029 public: 00030 int length; //Number of bytes of data below. 00031 char *data; //Message data. 00032 #if CMK_ERROR_CHECKING 00033 int checkTag; // For detecting message corruption 00034 #endif 00035 00036 inline int getLength(void) const {return length;} 00037 inline int getSize(void) const {return length;} 00038 inline void *getData(void) const {return data;} 00039 00041 static CkDataMsg *buildNew(int length,const void *data); 00042 00043 void check(void); 00044 }; 00045 00046 00047 #ifdef CcsRegisterHandler /*pollution from C conv-ccs header*/ 00048 # undef CcsRegisterHandler 00049 #endif 00050 00061 void CcsRegisterHandler(const char *ccs_handlername,const CkCallback &cb); 00062 00063 00064 #endif