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

C++ identify函数代码示例

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

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



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

示例1: backend

Mapdesc::Mapdesc( long _type, int _israt, int _ncoords, Backend& b ) 
    : backend( b )
{
    type 		= _type;
    isrational 		= _israt;
    ncoords 		= _ncoords;
    hcoords		= _ncoords + (_israt ? 0 : 1 );
    inhcoords		= _ncoords - (_israt ? 1 : 0 );
    mask 		= ((1<<(inhcoords*2))-1);
    next		= 0;

    assert( hcoords <= MAXCOORDS );
    assert( inhcoords >= 1 );

    pixel_tolerance 	= 1.0;
    error_tolerance	= 1.0;
    bbox_subdividing	= N_NOBBOXSUBDIVISION;
    culling_method 	= N_NOCULLING;		
    sampling_method 	= N_NOSAMPLING;
    clampfactor 	= N_NOCLAMPING;
    minsavings 		= N_NOSAVINGSSUBDIVISION;
    s_steps  		= 0.0;
    t_steps 		= 0.0;
    maxrate 		= ( s_steps < 0.0 ) ? 0.0 : s_steps;
    maxsrate 		= ( s_steps < 0.0 ) ? 0.0 : s_steps;
    maxtrate 		= ( t_steps < 0.0 ) ? 0.0 : t_steps;
    identify( bmat );
    identify( cmat );
    identify( smat );
    for( int i = 0; i != inhcoords; i++ )
	bboxsize[i] = 1.0;
}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:32,代码来源:mapdesc.cpp


示例2: eventReceiveError

void eventReceiveError(mixed *packet) {
    object ob;
    string error_code, mud, target, msg;

    tn("ERROR RECEIVED: "+identify(packet));
    LOG_D->LogSpecial(LOG_I3ERR ,timestamp()+" "+identify(packet)+"\n");
    if( packet[5] ) {
        tn("exceptio probat regulam");
        target = convert_name(packet[5]);
        if( !(ob = find_player(target)) ) write("Can't find "+packet[5]);;
    }
    mud = packet[2];
    error_code = packet[6];
    //msg = packet[7];
    //packet = packet[8];
    //tn("errorcode: "+error_code);
    switch(error_code) {
        case "unk-src":
            //update("/daemon/intermud");
            return;
        case "unk-dst": case "not-imp": case "unk-type":
            return;
        case "unk-user":
            if( !ob ) return;
        message("system", (msg ? msg : "Unknown user reported from " + mud +
                    "."), ob);
        return;
    }
}
开发者ID:Lundex,项目名称:bloodlines,代码行数:29,代码来源:error.c


示例3: hardfault_get_desc

/****************************************************************************
 * hardfault_get_desc
 ****************************************************************************/
static int hardfault_get_desc(char *caller, struct bbsramd_s *desc, bool silent)
{
	int ret = -ENOENT;
	int fd = open(HARDFAULT_PATH, O_RDONLY);

	if (fd < 0) {
		if (!silent) {
			identify(caller);
			syslog(LOG_INFO, "Failed to open Fault Log file [%s] (%d)\n", HARDFAULT_PATH, fd);
		}

	} else {
		ret = -EIO;
		int rv = ioctl(fd, PX4_BBSRAM_GETDESC_IOCTL, (unsigned long)((uintptr_t)desc));

		if (rv >= 0) {
			ret = fd;

		} else {
			identify(caller);
			syslog(LOG_INFO, "Failed to get Fault Log descriptor (%d)\n", rv);
		}
	}

	return ret;
}
开发者ID:andre-nguyen,项目名称:Firmware,代码行数:29,代码来源:hardfault_log.c


示例4: Mutex

ATAController::ATAController(u32int base, u8int number) : Mutex(MUTEX_TRUE) {
	m_base = base; m_number = number;
	m_drives[0] = NULL; m_drives[1] = NULL;
	identify(false);	//Identify master device
	identify(true);		//Identify slave device
	unlock();
}
开发者ID:Alexis211,项目名称:Melon,代码行数:7,代码来源:ATAController.class.cpp


示例5: cmd_cref

int cmd_cref( string a )
{
  mixed ob;
  object new_ob;
  string name, num;

  seteuid( geteuid( previous_object() ) );

  if( !a ) a = "#default";
  ob = ref_ob( a );
  if( !objectp( ob ) )
  {
    notify_fail( wrap( "Could not identify " + identify( ob ) +
      " as an object." ) );
    return 0;
  }
  name = file_name( ob );
  if( sscanf( name, "%s#%s", ob, num ) < 2 )
    ob = name;
  if( catch( new_ob = new( ob ) ) )
    { notify_fail( "Could not clone " + ob + "\n" ); return 0; }
  write( "CLONE: You have created " + identify( new_ob ) + "\n" );
  if( new_ob-> move( this_player() ) != MOVE_OK )
    new_ob-> move( environment( this_player() ) );
  set_ref( 0, new_ob );
  return 1;
}
开发者ID:ehershey,项目名称:pd,代码行数:27,代码来源:_cref.c


示例6: cmd_exits

int cmd_exits() {
   int loop;
   mapping exits;
   string short;

   if (!TP->query_vision()) {
      write("It's too dark for you to see the exits!\n");
      return 1;
   }
   
   exits = (mapping) environment(previous_object()) -> query("exits");
   
   if (!exits || !mapp(exits)) {
      notify_fail("There are no exits here, from what you can tell.\n");
      return 0;
   }
   
   write("Exits for " + bold(environment(previous_object()) -> 
         query("short")) + ":\n");
   
   for( loop = 0; loop < sizeof(keys(exits)); loop++ ) {
      if( catch(values(exits)[loop] -> XXX())) {
         if (wizardp(previous_object()))
            write("Unloadable room : " + identify(keys(exits)[loop]) +
            "\t-> " + identify(values(exits)[loop]) + "\n");
         continue;
       }
      write("  " + pad(capitalize(keys(exits)[loop]), 13) + ":   " +
         (string) values(exits)[loop] -> query("short") + "\n");
   }
   return 1;
}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:32,代码来源:_exits.c


示例7: main

int main(int argc,char **argv) {
	FILE *fi;
	int i,pic,t1,t2,no,left,right;
	char s[64];
	if(argc<2) puts("usage: e n, where n is input (1 or 2)"),exit(0);
	no=strtol(argv[1],0,10);
	if(no<1 || no>2) puts("n must be 1 or 2"),exit(0);
	for(pic=0;;pic++) {
		sprintf(s,"e%d_%02d.bmp",no,pic);
		fi=fopen(s,"rb");
		if(!fi) break;
		len=fread(buf,1,5000000,fi);
		hp=(len-H)/120;
		num=hp/80;
		/* analyse each pair */
		left=right=0;
		for(i=num-1;i>=0;i--) {
			t1=identify(i,0);
			t2=identify(i,1);
			if(t1==(t2+1)%3) left++;
			else if(t1==(t2+2)%3) right++;
		}
		if(left>right) puts("LEFT");
		else if(left<right) puts("RIGHT");
		else puts("DRAW");
		fclose(fi);
	}
	return 0;
}
开发者ID:noodles-v6,项目名称:ACM,代码行数:29,代码来源:e.c


示例8: hardfault_write

__EXPORT int hardfault_write(char *caller, int fd, int format, bool rearm)
{
	struct bbsramd_s desc;

	switch (format) {

	case HARDFAULT_FILE_FORMAT:
	case HARDFAULT_DISPLAY_FORMAT:
		break;

	default:
		return -EINVAL;
	}

	int ret = hardfault_get_desc(caller, &desc, false);

	if (ret >= 0) {
		int hffd = ret;


		int rv =  hardfault_dowrite(caller, hffd, fd, &desc, format);

		ret = close(hffd);

		if (ret < 0) {
			identify(caller);
			syslog(LOG_INFO, "Failed to Close Fault Log (%d)\n", ret);

		}

		if (rv == OK && rearm) {
			ret = hardfault_rearm(caller);

			if (ret < 0) {
				identify(caller);
				syslog(LOG_INFO, "Failed to re-arm Fault Log (%d)\n", ret);
			}
		}

		if (ret == OK) {
			ret = rv;
		}

		if (ret != OK) {
			identify(caller);
			syslog(LOG_INFO, "Failed to Write Fault Log (%d)\n", ret);
		}
	}

	return ret;
}
开发者ID:andre-nguyen,项目名称:Firmware,代码行数:51,代码来源:hardfault_log.c


示例9: hardfault_check_status

/****************************************************************************
 * hardfault_check_status
 ****************************************************************************/
__EXPORT int hardfault_check_status(char *caller)
{
	int state = -1;
	struct bbsramd_s desc;
	int ret = hardfault_get_desc(caller, &desc, true);

	if (ret < 0) {
		identify(caller);

		if (ret == -ENOENT) {
			syslog(LOG_INFO, "Fault Log is Armed\n");

		} else {
			syslog(LOG_INFO, "Failed to open Fault Log file [%s] (%d)\n", HARDFAULT_PATH, ret);
		}

	} else {
		int fd = ret;
		state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ?  OK : 1;
		int rv = close(fd);

		if (rv < 0) {
			identify(caller);
			syslog(LOG_INFO, "Failed to Close Fault Log (%d)\n", rv);

		} else {
			ret = state;
			identify(caller);
			syslog(LOG_INFO, "Fault Log info File No %d Length %d flags:0x%02x state:%d\n",
			       (unsigned int)desc.fileno, (unsigned int) desc.len, (unsigned int)desc.flags, state);

			if (state == OK) {
				char buf[TIME_FMT_LEN + 1];
				format_fault_time(HEADER_TIME_FMT, &desc.lastwrite, buf, arraySize(buf));
				identify(caller);
				syslog(LOG_INFO, "Fault Logged on %s - Valid\n", buf);

			} else {
				rv = hardfault_rearm(caller);

				if (rv < 0) {
					ret = rv;
				}
			}
		}
	}

	return ret;
}
开发者ID:andre-nguyen,项目名称:Firmware,代码行数:52,代码来源:hardfault_log.c


示例10: cmd_move

int cmd_move( string a )
{
mixed o1, o2;
  string str;
  int ret;

    if(member_group(geteuid(previous_object()), "ambassador")) return 0;
  if( !a || ( sscanf( a, "%s to %s", o1, o2 ) < 2 ) )
    { notify_fail( SYNTAX ); return 0; }

  seteuid( geteuid( previous_object() ) );

  o1 = ref_ob( o1 );
  if( !objectp( o1 ) )
  {
    notify_fail( wrap( "Could not identify " + identify( o1 ) +
      " as an object." ) );
    return 0;
  }
  o2 = ref_ob( o2 );
  if( !objectp( o2 ) )
  {
    notify_fail( wrap( "Could not identify " + identify( o2 ) +
     " as an object." ) );
    return 0;
  }
  set_ref( 0, o2 );
  write( wrap( "Moving " + identify( o1 ) + " to " + identify( o2 ) + "..." ) );
  ret = o1-> move( o2 );
  switch( ret )
  {
    case MOVE_OK:		str = "Move OK.\n"; break;
    case MOVE_NOT_ALLOWED:	str = "Move not allowed.\n"; break;
    case MOVE_NO_ROOM:		str = "No room in object2 for object1\n"; break;
    case MOVE_DESTRUCTED:	str = "Move destructed\n"; break;
    case MOVE_NO_DEST:		str = "object2 is not a destination\n"; break;
#ifdef MOVE_TOO_HEAVY
    case MOVE_TOO_HEAVY:	str = "object1 too heavy for object2\n"; break;
#endif /* MOVE_TOO_HEAVY */
#ifdef MOVE_DOOR_CLOSED
    case MOVE_DOOR_CLOSED:	str = "The door is closed.\n"; break;
#endif /* MOVE_DOOR_CLOSED */
    default: str = "Error: move return code " + ret + "\n"; break;
  }
  if( ret == MOVE_OK ) { write( str ); return 1; }
  notify_fail( str ); 
  return 0;
}
开发者ID:ehershey,项目名称:pd,代码行数:48,代码来源:_move.c


示例11: start_handler

/**
 * Start Handler for the Expat parser.
 */
void start_handler(void* data, const XML_Char* name, const XML_Char** attributes)
{
	struct state_t* state = (struct state_t*)data;
	struct conversion_t* c;
	unsigned i;

	++state->depth;

	if (state->depth < DEPTH_MAX) {
		state->level[state->depth].tag = name;
		state->level[state->depth].data = 0;
		state->level[state->depth].len = 0;

		if (state->error == 0) {
			c = identify(state->depth, state->level);
			if (c) {
				state->level[state->depth].process = c->process;
				state->level[state->depth].process(state, token_open, 0, 0, attributes);
			} else {
				state->level[state->depth].process = 0;
			}

			for(i=0;attributes[i];i+=2) {
				const char* null_atts[1] = { 0 };
				start_handler(data, attributes[i], null_atts);
				data_handler(data, attributes[i+1], strlen(attributes[i+1]));
				end_handler(data, attributes[i]);
			}
		} else {
			state->level[state->depth].process = 0;
		}
	}
}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:36,代码来源:xml2info.c


示例12: PropConfused

void PotionOfConfusion::quaff_(Actor* const actor) {
  actor->getPropHandler().tryApplyProp(
    new PropConfused(eng, propTurnsStd));
  if(eng.player->isSeeingActor(*actor, NULL)) {
    identify(false);
  }
}
开发者ID:jachamp,项目名称:ia,代码行数:7,代码来源:ItemPotion.cpp


示例13: identify

void PotionOfClairvoyance::quaff_(Actor* const actor) {
  if(actor == eng.player) {
    eng.log->addMsg("I see far and wide!");

    vector<Pos> animPositions;
    animPositions.resize(0);

    bool blockers[MAP_W][MAP_H];
    MapParse::parse(CellPred::BlocksVision(eng), blockers);
    for(int y = 0; y < MAP_H; y++) {
      for(int x = 0; x < MAP_W; x++) {
        Cell& cell = eng.map->cells[x][y];
        if(blockers[x][y] == false && cell.isDark == false) {
          cell.isExplored = true;
          cell.isSeenByPlayer = true;
          animPositions.push_back(Pos(x, y));
        }
      }
    }

    Renderer::drawMapAndInterface(false);
//    eng.map->updateVisualMemory();
    eng.player->updateFov();

    Renderer::drawBlastAnimAtPositions(animPositions, clrWhite);
  }
  identify(false);
}
开发者ID:jachamp,项目名称:ia,代码行数:28,代码来源:ItemPotion.cpp


示例14: identify

Real LC::run() {
    if( props.verbose >= 1 )
        cerr << "Starting " << identify() << "...";
    if( props.verbose >= 2 )
        cerr << endl;

    double tic = toc();

    Real md = InitCavityDists( props.cavainame, props.cavaiopts );
    if( md > _maxdiff )
        _maxdiff = md;

    for( size_t i = 0; i < nrVars(); i++ ) {
        _pancakes[i] = _cavitydists[i];

        foreach( const Neighbor &I, nbV(i) ) {
            _pancakes[i] *= factor(I);
            if( props.updates == Properties::UpdateType::SEQRND )
              _pancakes[i] *= _phis[i][I.iter];
        }

        _pancakes[i].normalize();

        CalcBelief(i);
    }
开发者ID:afbarnard,项目名称:libdai,代码行数:25,代码来源:lc.cpp


示例15: qDebug

void WfipsIdentifyMapTool::canvasReleaseEvent( QMouseEvent *e )
{
    QList<QgsMapToolIdentify::IdentifyResult> results;
    qDebug() << "Identify point(" << e->x() << ", " << e->y() << ")";
    results = identify( e->x(), e->y(), ActiveLayer );
    emit WfipsIdentify( results );
}
开发者ID:firelab,项目名称:wfips,代码行数:7,代码来源:wfipsidentifymaptool.cpp


示例16: DEFINE_LOADER_PLUGIN_LOAD

DEFINE_LOADER_PLUGIN_LOAD(p, st, vw
#if !defined(IDENTIFY_BEFORE_LOAD)
__attribute__((unused))
#endif
, c
#if !defined(IDENTIFY_BEFORE_LOAD)
__attribute__((unused))
#endif
, priv
#if !defined(IDENTIFY_BEFORE_LOAD)
__attribute__((unused))
#endif
)
{
  debug_message("gif loader: load() called\n");

#ifdef IDENTIFY_BEFORE_LOAD
  {
    LoaderStatus status;

    if ((status = identify(p, st, vw, c, priv)) != LOAD_OK)
      return status;
    stream_rewind(st);
  }
#endif

  return load_image(p, st);
}
开发者ID:sina-ht,项目名称:enfle,代码行数:28,代码来源:gif.c


示例17: names

bool IdentificationObj::event(QEvent *event) {
  if (event->type() == QueryEvent::type()) {
    QueryEvent *queryEvent = static_cast<QueryEvent *>(event);
    std::unique_ptr<cv::Mat> image = queryEvent->takeImage();
    std::unique_ptr<CameraModel> camera = queryEvent->takeCameraModel();
    std::unique_ptr<Session> session = queryEvent->takeSession();

    std::unique_ptr<std::vector<std::string>> names(
        new std::vector<std::string>);
    bool success = identify(*image, *camera, *names, *session);

    if (success) {
      if (session->type == BOSSWAVE) {
        QCoreApplication::postEvent(
            _bwFrontEndObj.get(),
            new DetectionEvent(std::move(names), std::move(session)));
      } else {
        QCoreApplication::postEvent(
            _httpFrontEndObj.get(),
            new DetectionEvent(std::move(names), std::move(session)));
      }
    } else {
      if (session->type == BOSSWAVE) {
        QCoreApplication::postEvent(_bwFrontEndObj.get(),
                                    new FailureEvent(std::move(session)));
      } else {
        QCoreApplication::postEvent(_httpFrontEndObj.get(),
                                    new FailureEvent(std::move(session)));
      }
    }
    return true;
  }
  return QObject::event(event);
}
开发者ID:SoftwareDefinedBuildings,项目名称:CellMate,代码行数:34,代码来源:IdentificationObj.cpp


示例18: START_TEST

}END_TEST

START_TEST(test_identify_double_op){
	State *dfa = generate_operator_dfa();
	TokenList token;
	TokenList *tok=&token;
	tok->token.word=strdup("cmd>>one<<tw\\|o");
	//tok->token.word=strdup("cmd>>one");
	tok->token.type=TOK_NULL;
	tok->next=NULL;
	identify(tok,dfa);
	//fail_unless(split==(SPLIT_BEFORE|SPLIT_AFTER));
	//fprintf(stderr,"WORDS:\n%s\n%s\n%s\n%s\n%s\n",	tok->token.word,
												//tok->next->token.word,
												//tok->next->next->token.word,
												//tok->next->next->next->token.word,
												//tok->next->next->next->next->token.word);
	fail_unless(strcmp(tok->token.word,"cmd")==0);
	fail_unless(strcmp(tok->next->token.word,">>")==0);
	fail_unless(strcmp(tok->next->next->token.word,"one")==0);
	fail_unless(strcmp(tok->next->next->next->token.word,"<<")==0);
	fail_unless(strcmp(tok->next->next->next->next->token.word,"tw\\|o")==0);
	fail_unless(tok->token.type==TOK_NULL && tok->next->token.type==(TOK_REDIRECT|TOK_GTGT) && 
				tok->next->next->token.type==TOK_NULL && tok->next->next->next->token.type==(TOK_REDIRECT|TOK_LTLT) &&
				tok->next->next->next->next->token.type==TOK_NULL);
	free(tok->token.word);
}END_TEST
开发者ID:heckendorfc,项目名称:bluesh,代码行数:27,代码来源:check_lex.c


示例19: mmconline

static int
mmconline(SDunit *unit)
{
	int hcs, i;
	u32int r[4];
	Ctlr *ctl;
	SDio *io;

	ctl = unit->dev->ctlr;
	io = ctl->io;
	assert(unit->subno == 0);

	if(waserror()){
		unit->sectors = 0;
		return 0;
	}
	if(unit->sectors != 0){
		io->cmd(SEND_STATUS, ctl->rca<<Rcashift, r);
		poperror();
		return 1;
	}
	io->cmd(GO_IDLE_STATE, 0, r);
	hcs = 0;
	if(!waserror()){
		io->cmd(SD_SEND_IF_COND, Voltage|Checkpattern, r);
		if(r[0] == (Voltage|Checkpattern))	/* SD 2.0 or above */
			hcs = Hcs;
		poperror();
	}
	for(i = 0; i < Inittimeout; i++){
		delay(100);
		io->cmd(APP_CMD, 0, r);
		io->cmd(SD_SEND_OP_COND, hcs|V3_3, r);
		if(r[0] & Powerup)
			break;
	}
	if(i == Inittimeout){
		print("sdmmc: card won't power up\n");
		poperror();
		return 2;
	}
	ctl->ocr = r[0];
	io->cmd(ALL_SEND_CID, 0, r);
	memmove(ctl->cid, r, sizeof ctl->cid);
	io->cmd(SEND_RELATIVE_ADDR, 0, r);
	ctl->rca = r[0]>>16;
	io->cmd(SEND_CSD, ctl->rca<<Rcashift, r);
	memmove(ctl->csd, r, sizeof ctl->csd);
	identify(unit, ctl->csd);
	io->cmd(SELECT_CARD, ctl->rca<<Rcashift, r);
	io->cmd(SET_BLOCKLEN, unit->secsize, r);
	io->cmd(APP_CMD, ctl->rca<<Rcashift, r);
	io->cmd(SET_BUS_WIDTH, Width4, r);
	if(!waserror()){
		mmcswitchfunc(io, Hispeed|Setfunc);
		poperror();
	}
	poperror();
	return 1;
}
开发者ID:sirnewton01,项目名称:rpi-9front,代码行数:60,代码来源:sdmmc.c


示例20: main

int main(int argc, char* argv[]) {
	// output name
	identify(argv[0]);

	// parse command line
	unsigned short int port = 5908;
	if(argc > 1){
		port = atoi(argv[1]);
	}

	UDPServer server(port);
	try{
		server.bind();
		while(1){
			const char *buffer = server.receive();
			if(buffer){
				std::cout << "Received data :|" << buffer << "|" << std::endl;
			}else{
				std::cout << "Received dirty data" << std::endl;
			}
		}
	}catch(UDPServer::Error &err){
		err.print();
		return EXIT_FAILURE;
	}
	return EXIT_SUCCESS;
}
开发者ID:BruceBlank,项目名称:UDPEcho,代码行数:27,代码来源:UDPEchoServer.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ identity函数代码示例发布时间:2022-05-30
下一篇:
C++ identifier函数代码示例发布时间: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