本文整理汇总了C++中pup::er::comment方法的典型用法代码示例。如果您正苦于以下问题:C++ er::comment方法的具体用法?C++ er::comment怎么用?C++ er::comment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pup::er
的用法示例。
在下文中一共展示了er::comment方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pupSingleMessage
void pupSingleMessage(PUP::er &p, int curObj, void *msg) {
beginItem(p,curObj);
int isCharm=0;
const char *type="Converse";
p.comment("name");
char name[128];
if (msg == (void*)-1) {
type="Sentinel";
p((char*)type, strlen(type));
return;
}
#if ! CMK_BIGSIM_CHARM
if (CmiGetHandler(msg)==_charmHandlerIdx) {isCharm=1; type="Local Charm";}
if (CmiGetXHandler(msg)==_charmHandlerIdx) {isCharm=1; type="Network Charm";}
#else
isCharm=1; type="BG";
#endif
if (curObj < 0) type="Conditional";
sprintf(name,"%s %d: %s (%d)","Message",curObj,type,CmiGetHandler(msg));
p(name, strlen(name));
if (isCharm)
{ /* charm message */
p.comment("charmMsg");
p.synchronize(PUP::sync_begin_object);
envelope *env=(envelope *)msg;
CkUnpackMessage(&env);
//messages[curObj]=env;
CpdPupMessage(p, EnvToUsr(env));
//CkPupMessage(p, &messages[curObj], 0);
p.synchronize(PUP::sync_end_object);
}
}
示例2: pup
virtual void pup(PUP::er &p, CpdListItemsRequest &req) {
for (int i=0; i<_debugData.length(); ++i) {
beginItem(p, i);
void *obj = _debugData[i].obj;
p.comment("obj");
pup_pointer(&p, &obj);
void *msg = _debugData[i].msg;
p.comment("msg");
pup_pointer(&p, &msg);
}
}
示例3: pup
void CkQuadView::pup(PUP::er &p) {
CkView::pup(p);
p.comment("Texture corners");
p|nCorners;
for (int i=0;i<nCorners;i++) {
p|corners[i];
p|texCoord[i];
}
// Pup the image:
x_tex.pup(p);
#ifdef CMK_LIVEVIZ3D_CLIENT
if (p.isUnpacking()) { /* immediately upload image to OpenGL */
CkAllocImage *img=x_tex.getImage();
oglTextureFormat_t fmt=oglImageFormat(*img);
c_tex=new oglLilTex(img->getData(),x_tex.gl_w,x_tex.gl_h,
fmt.format,fmt.type);
stats::get()->add(x_tex.w*x_tex.h,op_upload_pixels);
stats::get()->add(x_tex.gl_w*x_tex.gl_h,op_uploadpad_pixels);
/// Scale texture coordinates from the partial image to OpenGL fractions:
double tx=x_tex.w/(double)x_tex.gl_w;
double ty=x_tex.h/(double)x_tex.gl_h;
for (int i=0;i<nCorners;i++)
texCoord[i]=c_tex->texCoord(
CkVector3d(tx*texCoord[i].x,ty*texCoord[i].y,texCoord[i].z)
);
//Now that we've copied the view into GL,
// flush the old in-memory copy:
delete img;
}
#endif
}
示例4: pup
virtual void pup(PUP::er &p,CpdListItemsRequest &req) {
CkHashtableIterator *it=tab->iterator();
void *objp;
int curObj=0;
while (NULL!=(objp=it->next())) {
if (curObj>=req.lo && curObj<req.hi) {
CpdListAccessor *acc=*(CpdListAccessor **)objp;
char *pathName=(char *)acc->getPath();
beginItem(p,curObj);
p.comment("name");
p(pathName,strlen(pathName));
}
curObj++;
}
}
示例5: pup
void CkViewpoint::pup(PUP::er &p) {
p.comment("CkViewpoint {");
p.comment("axes");
p|X; p|Y; p|Z;
p.comment("origin");
p|R;
p.comment("eye");
p|E;
p.comment("width and height");
p|wid; p|ht;
p.comment("perspective");
p|isPerspective;
p.comment("} CkViewpoint");
if (p.isUnpacking()) buildM();
}
示例6: CpdPupMessage
// Interpret data in a message in a user-friendly way.
// Ignores most of the envelope fields used by CkPupMessage,
// and instead concentrates on user data
void CpdPupMessage(PUP::er &p, void *msg)
{
envelope *env=UsrToEnv(msg);
//int wasPacked=env->isPacked();
int size=env->getTotalsize();
int prioBits=env->getPriobits();
int from=env->getSrcPe();
PUPn(from);
//PUPn(wasPacked);
PUPn(prioBits);
int userSize=size-sizeof(envelope)-sizeof(int)*CkPriobitsToInts(prioBits);
PUPn(userSize);
int msgType = env->getMsgIdx();
PUPn(msgType);
int envType = env->getMsgtype();
PUPn(envType);
//p.synchronize(PUP::sync_last_system);
int ep=CkMessageToEpIdx(msg);
PUPn(ep);
// Pup the information specific to this envelope type
if (envType == ForArrayEltMsg || envType == ArrayEltInitMsg) {
int arrID = env->getArrayMgr().idx;
PUPn(arrID);
CkArrayIndex &idx = env->getsetArrayIndex();
int nInts = idx.nInts;
int dimension = idx.dimension;
PUPn(nInts);
PUPn(dimension);
p.comment("index");
if (dimension >=4 && dimension <=6) {
p((short int *)idx.index, dimension);
} else {
p(idx.index, nInts);
}
} else if (envType == ForNodeBocMsg || envType == ForBocMsg) {
int groupID = env->getGroupNum().idx;
PUPn(groupID);
} else if (envType == BocInitMsg || envType == NodeBocInitMsg) {
int groupID = env->getGroupNum().idx;
PUPn(groupID);
} else if (envType == NewVChareMsg || envType == ForVidMsg || envType == FillVidMsg) {
p.comment("ptr");
void *ptr = env->getVidPtr();
pup_pointer(&p, &ptr);
} else if (envType == ForChareMsg) {
p.comment("ptr");
void *ptr = env->getObjPtr();
pup_pointer(&p, &ptr);
}
/* user data */
p.comment("data");
p.synchronize(PUP::sync_begin_object);
if (_entryTable[ep]->messagePup!=NULL)
_entryTable[ep]->messagePup(p,msg);
else
CkMessage::ckDebugPup(p,msg);
p.synchronize(PUP::sync_end_object);
}