• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ READ_INT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中READ_INT函数的典型用法代码示例。如果您正苦于以下问题:C++ READ_INT函数的具体用法?C++ READ_INT怎么用?C++ READ_INT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了READ_INT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: BaseConstructL

/**
 *	constructL method that creates the AppView object
 *	
 */  
void CTApp1Ui::ConstructL()
    {
    BaseConstructL();
	CWsScreenDevice * screen = CCoeEnv::Static()->ScreenDevice();
	TSize screenSize=screen->SizeInPixels();
	
	TInt posX = 0;
	READ_INT(KTApp1PositionX, KWServTApp1ConfigFile, posX);
	CalculateAbsL(posX, screenSize.iWidth);
	
	TInt posY = 0;
	READ_INT(KTApp1PositionY, KWServTApp1ConfigFile, posY);
	CalculateAbsL(posY, screenSize.iHeight);
	
	TInt width = 0;
	READ_INT(KTApp1Width, KWServTApp1ConfigFile, width);
	CalculateAbsL(width, screenSize.iWidth);
	
	TInt height = 0;
	READ_INT(KTApp1Height, KWServTApp1ConfigFile, height);
	CalculateAbsL(height, screenSize.iHeight);
	
    TRect myRect(TPoint(posX,posY), TPoint(width+posX,height+posY));
	iAppView = CTApp1View::NewL(myRect);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:29,代码来源:t_app1ui.cpp


示例2: ASSERT

//===============================================================================
void JamAndShootSkill::loadValues()
{
  ///Open the paramater file:
  ///REMEMBER TO CHANGE THE PARAMETER TEXT FILE NAME TO THE APPROPRIATE NAME!
  ifstream mainFile;
  mainFile.open("Params/Skill_Params/JamAndShootSkillParams.txt", ios::nocreate);
  
  ASSERT(mainFile.fail() == 0, "CAN'T OPEN PARAMETER FILE!");

  //Load parameter values.  See params.h and params.cpp for good examples.
  //################  ADD PARAMETERS BELOW ################  
  READ_FLOAT(WAIT_TIME);
  READ_FLOAT(DRIFT_ANGLE);
  READ_FLOAT(AIM_ANGLE);
  READ_FLOAT(RANDOM_ANGLE);
  READ_FLOAT(EDGE_ANGLE);
  READ_FLOAT(AIM_DISTANCE);
  READ_FLOAT(FINISHED_TIME);
  READ_FLOAT(VALID_ANGLE);
  READ_FLOAT(BOUNCE_ANGLE);
  READ_FLOAT(ENTERBOX_CAUTION_DIST);
  READ_FLOAT(SIDE_DIST);
  READ_FLOAT(SIDE_LANE_FACTOR);
  READ_FLOAT(DRIFT_ADJUST_ANGLE);
  READ_INT(PAUSE_FRAMES);
  READ_INT(PAUSE_RANDOM);
  //################  ADD PARAMETERS ABOVE ################
  mainFile.close();
  
}
开发者ID:lordhippo,项目名称:cornell-robocup,代码行数:31,代码来源:JamAndShootSkill.cpp


示例3: createcurse_read

static int createcurse_read(trigger * t, gamedata *data)
{
    createcurse_data *td = (createcurse_data *)t->data.v;
    char zText[128];
    float flt;

    read_reference(&td->mage, data, read_unit_reference, resolve_unit);
    read_reference(&td->target, data, read_unit_reference, resolve_unit);

    READ_TOK(data->store, zText, sizeof(zText));
    td->type = ct_find(zText);
    READ_FLT(data->store, &flt);
    td->vigour = flt;
    READ_INT(data->store, &td->duration);
    if (data->version < CURSEFLOAT_VERSION) {
        int n;
        READ_INT(data->store, &n);
        td->effect = (float)n;
    }
    else {
        READ_FLT(data->store, &flt);
        td->effect = flt;
    }
    READ_INT(data->store, &td->men);
    return AT_READ_OK;
}
开发者ID:CTD1,项目名称:eressea-server-bugfixing,代码行数:26,代码来源:createcurse.c


示例4: read_groups

void read_groups(struct storage *store, faction * f)
{
  for (;;) {
    ally **pa;
    group *g;
    int gid;
    char buf[1024];

    READ_INT(store, &gid);
    if (gid == 0)
      break;
    READ_STR(store, buf, sizeof(buf));
    g = new_group(f, buf, gid);
    pa = &g->allies;
    for (;;) {
      ally *a;
      variant fid;
      READ_INT(store, &fid.i);
      if (fid.i <= 0)
        break;
      if (global.data_version < STORAGE_VERSION && fid.i == 0)
        break;
      a = malloc(sizeof(ally));
      *pa = a;
      pa = &a->next;
      READ_INT(store, &a->status);

      a->faction = findfaction(fid.i);
      if (!a->faction)
        ur_add(fid, &a->faction, resolve_faction);
    }
    *pa = 0;
    a_read(store, &g->attribs, g);
  }
}
开发者ID:TomBraun,项目名称:server,代码行数:35,代码来源:group.c


示例5: ReadParameters

void ReadParameters(int *xlength, float *tau, float *velocity_wall, int *timesteps,
		int *timesteps_per_plotting, int argc, char *argv[], int *gpu_enabled, int *gpu_streaming,
        int *gpu_collision, int *gpu_boundaries){
    float *velocity_wall_1, *velocity_wall_2, *velocity_wall_3;
    
    if(argc<3) PrintHelpMessage();
    if(!strcmp(argv[1], "-help") || !strcmp(argv[2], "-help")) PrintHelpMessage();
    if(access(argv[1], R_OK) != 0)
        ERROR("Provided configuration file path either doesn't exist or can not be read.");
    
    if(!strcmp(argv[2], "-gpu")) *gpu_enabled=1; else *gpu_enabled=0;
    if(!strcmp(argv[2], "-gpu-streaming")) *gpu_streaming=1; else *gpu_streaming=0;
    if(!strcmp(argv[2], "-gpu-collision")) *gpu_collision=1; else *gpu_collision=0;
    if(!strcmp(argv[2], "-gpu-boundaries")) *gpu_boundaries=1; else *gpu_boundaries=0;

    READ_FLOAT(argv[1], *tau);

    velocity_wall_1=&velocity_wall[0];
    velocity_wall_2=&velocity_wall[1];
    velocity_wall_3=&velocity_wall[2];

    READ_FLOAT(argv[1], *velocity_wall_1);
    READ_FLOAT(argv[1], *velocity_wall_2);
    READ_FLOAT(argv[1], *velocity_wall_3);
    
    READ_INT(argv[1], *xlength);
    READ_INT(argv[1], *timesteps);
    READ_INT(argv[1], *timesteps_per_plotting);
}
开发者ID:TheProfitcy,项目名称:classwork,代码行数:29,代码来源:initialization.c


示例6: messageParseDataReply

/**
	requires MSG_DATA_REPLY -  reply for one piece:
		MSG_DATA_REPLY|piece_index|data_length|data

	@param msg Message to parse
	@param buf Memory to store data

	@return piece_index
*/
int messageParseDataReply(Message *msg, char *buf)
{
	assert(msg);
	assert(buf);

	messageDump(msg, "messageParseDataReply.txt");

	int piece_index = 0;
	int data_length = 0;
	int pos = 0;
	pos += 4;   // skip MessageType

	piece_index = READ_INT(msg->data + pos);
	verbose1("messageParseDataReply::piece_index = %d\n", piece_index);
	pos += 4;

	data_length = READ_INT(msg->data + pos);
	verbose1("messageParseDataReply::data_length = %d\n", data_length);
	pos += 4;

	memcpy(buf, msg->data + pos, data_length);
	pos += data_length;

	assert(pos == msg->length);

	return piece_index;
}
开发者ID:carbon28,项目名称:p2p_files,代码行数:36,代码来源:network.c


示例7: load_debuginfo

static int load_debuginfo(struct load_state *S, ktap_proto *f)
{
	int i,n;

	f->source = READ_STRING(S);
	n = READ_INT(S);
	f->sizelineinfo = n;
	f->lineinfo = NEW_VECTOR(S, n * sizeof(int));
	READ_VECTOR(S, f->lineinfo, n * sizeof(int));
	n = READ_INT(S);
	f->locvars = NEW_VECTOR(S, n * sizeof(struct ktap_locvar));
	f->sizelocvars = n;
	for (i = 0; i < n; i++)
		f->locvars[i].varname = NULL;
	for (i = 0; i < n; i++) {
		f->locvars[i].varname = READ_STRING(S);
		f->locvars[i].startpc = READ_INT(S);
		f->locvars[i].endpc = READ_INT(S);
	}
	n = READ_INT(S);
	for (i = 0; i < n; i++)
		f->upvalues[i].name = READ_STRING(S);

	return 0;
}
开发者ID:rousya,项目名称:ktap,代码行数:25,代码来源:loader.c


示例8: read_groups

void read_groups(struct storage *store, faction * f)
{
    for (;;) {
        ally **pa;
        group *g;
        int gid;
        char buf[1024];

        READ_INT(store, &gid);
        if (gid == 0)
            break;
        READ_STR(store, buf, sizeof(buf));
        g = new_group(f, buf, gid);
        pa = &g->allies;
        for (;;) {
            ally *a;
            variant fid;

            READ_INT(store, &fid.i);
            if (fid.i <= 0)
                break;
            a = ally_add(pa, findfaction(fid.i));
            READ_INT(store, &a->status);
            if (!a->faction)
                ur_add(fid, &a->faction, resolve_faction);
        }
        a_read(store, &g->attribs, g);
    }
}
开发者ID:Xolgrim,项目名称:server,代码行数:29,代码来源:group.c


示例9: readResults

static std::list<VersionedValue> * readResults(std::istream* inputStream) {
    std::list<VersionedValue>* responseList = 
        new std::list<VersionedValue>();

    try {
        uint32_t resultSize;
        READ_INT(inputStream, resultSize);

        for (uint32_t i = 0; i < resultSize; i++) {
            uint32_t valueSize;
            READ_INT(inputStream, valueSize);
            VectorClock* vc = NULL;
            std::string* value = NULL;
            int vcsize = 0;
            try {
                vc = readVectorClock(inputStream, vcsize);
                value = readBytes(inputStream, valueSize - vcsize);
            } catch (...) {
                if (vc) delete vc;
                if (value) delete value;
                throw;
            }
            VersionedValue vv(value, vc);
            responseList->push_back(vv);
        }
        return responseList;

    } catch (...) {
        if (responseList) delete responseList;
        throw;
    }
}
开发者ID:54k,项目名称:voldemort,代码行数:32,代码来源:VoldemortNativeRequestFormat.cpp


示例10: b_readroad

static void b_readroad(connection * b, storage * store)
{
  int n;
  READ_INT(store, &n);
  b->data.sa[0] = (short)n;
  READ_INT(store, &n);
  b->data.sa[1] = (short)n;
}
开发者ID:hochl,项目名称:server,代码行数:8,代码来源:connection.c


示例11: read_parameters

int read_parameters(
                    const char *szFileName,       /* name of the file */
                    double *Re,                /* reynolds number   */
                    double *UI,                /* velocity x-direction */
                    double *VI,                /* velocity y-direction */
                    double *PI,                /* pressure */
                    double *GX,                /* gravitation x-direction */
                    double *GY,                /* gravitation y-direction */
                    double *t_end,             /* end time */
                    double *xlength,           /* length of the domain x-dir.*/
                    double *ylength,           /* length of the domain y-dir.*/
                    double *dt,                /* time step */
                    double *dx,                /* length of a cell x-dir. */
                    double *dy,                /* length of a cell y-dir. */
                    int  *imax,                /* number of cells x-direction*/
                    int  *jmax,                /* number of cells y-direction*/
                    double *alpha,             /* uppwind differencing factor*/
                    double *omg,               /* relaxation factor */
                    double *tau,               /* safety factor for time step*/
                    int  *itermax,             /* max. number of iterations
                                                 for pressure per time step */
                    double *eps,               /* accuracy bound for pressure*/
                    double *dt_value,          /* time for output */
                    int *iproc,
                    int *jproc)
{
    READ_DOUBLE( szFileName, *xlength );
    READ_DOUBLE( szFileName, *ylength );
    
    READ_DOUBLE( szFileName, *Re    );
    READ_DOUBLE( szFileName, *t_end );
    READ_DOUBLE( szFileName, *dt    );
    
    READ_INT   ( szFileName, *imax );
    READ_INT   ( szFileName, *jmax );
    
    READ_DOUBLE( szFileName, *omg   );
    READ_DOUBLE( szFileName, *eps   );
    READ_DOUBLE( szFileName, *tau   );
    READ_DOUBLE( szFileName, *alpha );
    
    READ_INT   ( szFileName, *itermax );
    READ_DOUBLE( szFileName, *dt_value );
    
    READ_DOUBLE( szFileName, *UI );
    READ_DOUBLE( szFileName, *VI );
    READ_DOUBLE( szFileName, *GX );
    READ_DOUBLE( szFileName, *GY );
    READ_DOUBLE( szFileName, *PI );
    
    READ_INT   ( szFileName, *iproc );
    READ_INT   ( szFileName, *jproc );
    
    *dx = *xlength / (double)(*imax);
    *dy = *ylength / (double)(*jmax);
    
    return 1;
}
开发者ID:cfdlab,项目名称:tutorial4,代码行数:58,代码来源:init.c


示例12: b_readroad

static void b_readroad(connection * b, gamedata * data)
{
    storage * store = data->store;
    int n;
    READ_INT(store, &n);
    b->data.sa[0] = (short)n;
    READ_INT(store, &n);
    b->data.sa[1] = (short)n;
}
开发者ID:CTD1,项目名称:eressea-server-bugfixing,代码行数:9,代码来源:connection.c


示例13: wall_read

static void wall_read(connection * b, gamedata * data)
{
    static wall_data dummy;
    wall_data *fd = b->data.v ? (wall_data *)b->data.v : &dummy;

    read_unit_reference(data, &fd->mage, NULL);
    READ_INT(data->store, &fd->force);
    READ_INT(data->store, &fd->countdown);
    fd->active = true;
}
开发者ID:ennorehling,项目名称:eressea,代码行数:10,代码来源:borders.c


示例14: read_keyval

static int read_keyval(gamedata *data, int *keys, int n) {
    int i;
    for (i = 0; i != n; ++i) {
        int key, val;
        READ_INT(data->store, &key);
        READ_INT(data->store, &val);
        keys[i * 2] = key;
        keys[i * 2 + 1] = val;
    }
    return n;
}
开发者ID:ennorehling,项目名称:eressea,代码行数:11,代码来源:key.c


示例15: load_constants

static int load_constants(struct load_state *S, ktap_proto *f)
{
	int i,n;

	n = READ_INT(S);

	f->sizek = n;
	f->k = NEW_VECTOR(S, n * sizeof(ktap_value));
	for (i = 0; i < n; i++)
		setnilvalue(&f->k[i]);

	for (i=0; i < n; i++) {
		ktap_value *o = &f->k[i];

		int t = READ_CHAR(S);
		switch (t) {
		case KTAP_TNIL:
			setnilvalue(o);
			break;
		case KTAP_TBOOLEAN:
			setbvalue(o, READ_CHAR(S));
			break;
		case KTAP_TNUMBER:
			/*
			 * todo: kernel not support fp, check double when
			 * loading
			 */
			setnvalue(o, READ_NUMBER(S));
			break;
		case KTAP_TSTRING:
			setsvalue(o, READ_STRING(S));
			break;
		default:
			kp_error(S->ks, "ktap: load_constants: "
					"unknow ktap_value\n");
			return -1;
			
		}
	}

	n = READ_INT(S);
	f->p = NEW_VECTOR(S, n * sizeof(ktap_proto));
	f->sizep = n;
	for (i = 0; i < n; i++)
		f->p[i] = NULL;
	for (i = 0; i < n; i++) {
		f->p[i] = kp_newproto(S->ks);
		if (load_function(S, f->p[i]))
			return -1;
	}

	return 0;
}
开发者ID:rousya,项目名称:ktap,代码行数:53,代码来源:loader.c


示例16: read_skill

static int read_skill(struct storage *store, curse * c, void *target)
{
  int skill;
  if (global.data_version < CURSETYPE_VERSION) {
    READ_INT(store, &skill);
    READ_INT(store, 0); /* men, ignored */
  } else {
    READ_INT(store, &skill);
  }
  c->data.i = skill;
  return 0;
}
开发者ID:mideg,项目名称:server,代码行数:12,代码来源:unitcurse.c


示例17: read_encoders

void read_encoders(void)
{
	static uint32_t old_encoder_state0 = 0, old_encoder_state1;

	encoder_state0 = READ_INT(LEDADDR) & 0xFFFF0000;
	encoder_state1 = READ_INT(KEYADDR0);

	encoder_changed0 = old_encoder_state0 ^ encoder_state0;
	encoder_changed1 = old_encoder_state1^encoder_state1;

	old_encoder_state0 = encoder_state0;
	old_encoder_state1 = encoder_state1;
}
开发者ID:Razer6,项目名称:welecw2000a,代码行数:13,代码来源:DSO_FrontPanel.c


示例18: read_region_reference

variant read_region_reference(struct storage * store)
{
    variant result;
    if (global.data_version < UIDHASH_VERSION) {
        int n;
        READ_INT(store, &n);
        result.sa[0] = (short)n;
        READ_INT(store, &n);
        result.sa[1] = (short)n;
    }
    else {
        READ_INT(store, &result.i);
    }
    return result;
}
开发者ID:Xolgrim,项目名称:server,代码行数:15,代码来源:region.c


示例19: read_keyval_orig

static int read_keyval_orig(gamedata *data, int *keys, int n) {
    int i, j = 0, dk = -1;
    for (i = 0; i != n; ++i) {
        int key, val;
        READ_INT(data->store, &key);
        READ_INT(data->store, &val);
        if (key > dk) {
            keys[j * 2] = key;
            keys[j * 2 + 1] = val;
            dk = key;
            ++j;
        }
    }
    return j;
}
开发者ID:ennorehling,项目名称:eressea,代码行数:15,代码来源:key.c


示例20: read_skill

static int read_skill(struct storage *store, curse * c, void *target)
{
    int skill;
    READ_INT(store, &skill);
    c->data.i = skill;
    return 0;
}
开发者ID:philbooth,项目名称:server,代码行数:7,代码来源:unitcurse.c



注:本文中的READ_INT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ READ_INT_FIELD函数代码示例发布时间:2022-05-30
下一篇:
C++ READ_DONE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap