当前位置: 首页>>代码示例>>C++>>正文


C++ identify函数代码示例

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


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


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