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

C++ GetEvent函数代码示例

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

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



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

示例1: SetYAMLSequenceFromMapping

u32 SetYAMLSequenceFromMapping(char ***dest, char *key, ctr_yaml_context *ctx, bool StoreKey)
{
	if(*dest){
		fprintf(stderr,"[RSF ERROR] %s already set\n",key);
		ctx->error = YAML_MEM_ERROR;
		return 0;
	}

	u32 ActualCount = 0;
	u32 SlotCount = 0;
	char **tmp = *dest;
	if(!CheckMappingEvent(ctx)) return 0;
	SlotCount = 10;
	tmp = malloc((SlotCount+1)*sizeof(char*));
	if(!tmp){
		ctx->error = YAML_MEM_ERROR;
		return 0;
	}	
	memset(tmp,0,(SlotCount+1)*sizeof(char*));
	GetEvent(ctx);
	if(ctx->error || ctx->done) return 0;
	if(!EventIsScalar(ctx)){
		fprintf(stderr,"[RSF ERROR] '%s' requires a value\n",key);
		ctx->error = YAML_BAD_FORMATTING;
		return 0;
	}
	
	
	if(!GetYamlStringSize(ctx)) return 0;
	u32 InitLevel = ctx->Level;
	while(ctx->Level == InitLevel){
		if(ctx->error || ctx->done) return 0;
		if(ctx->IsKey == StoreKey){
			tmp[ActualCount] = malloc(GetYamlStringSize(ctx)+1);
			memset(tmp[ActualCount],0,GetYamlStringSize(ctx)+1);
			memcpy(tmp[ActualCount],GetYamlString(ctx),GetYamlStringSize(ctx));
			ActualCount++;
			if(ActualCount >= SlotCount){ // if Exceeding Ptr capacity, expand buffer
				SlotCount = SlotCount*2;
				char **tmp1 = malloc((SlotCount+1)*sizeof(char*)); // allocate new buffer
				if(!tmp1){
					ctx->error = YAML_MEM_ERROR;
					return 0;
				}	
				memset(tmp1,0,(SlotCount+1)*sizeof(char*));
				for(u32 i = 0; i < ActualCount; i++) tmp1[i] = tmp[i]; // Transfer ptrs
				free(tmp); // free original buffer
				tmp = tmp1; // transfer main ptr
			}
		}
		FinishEvent(ctx);
		GetEvent(ctx);
	}
	FinishEvent(ctx);
	*dest = tmp; // Give main ptr to location
	return ActualCount++; // return number of strings
}
开发者ID:44670,项目名称:Project_CTR,代码行数:57,代码来源:yaml_parser.c


示例2: Contains

bool EventsList::Contains(const gd::BaseEvent & eventToSearch, bool recursive) const
{
    for (std::size_t i = 0;i<GetEventsCount();++i)
    {
        if ( &GetEvent(i) == &eventToSearch) return true;
        if ( recursive && GetEvent(i).CanHaveSubEvents() && GetEvent(i).GetSubEvents().Contains(eventToSearch) )
            return true;
    }

    return false;
}
开发者ID:HaoDrang,项目名称:GD,代码行数:11,代码来源:EventsList.cpp


示例3: GetEvent

//_____________________________________
Bool_t KVINDRAReconIdent::Analysis(void)
{
   //For each event we:
   //     perform primary event identification and calibration and fill tree

   fEventNumber = GetEvent()->GetNumber();
   if (GetEvent()->GetMult() > 0) {
      GetEvent()->IdentifyEvent();
      GetEvent()->CalibrateEvent();
   }
   fIdentTree->Fill();
   return kTRUE;
}
开发者ID:pwigg,项目名称:kaliveda,代码行数:14,代码来源:KVINDRAReconIdent.cpp


示例4: sprintf

//-----------------------------------------------------------------------------
// Purpose: 
// Output : const char
//-----------------------------------------------------------------------------
const char *CChoreoEventWidget::GetLabelText( void )
{
	static char label[ 256 ];
	if ( GetEvent()->GetType() == CChoreoEvent::EXPRESSION )
	{
		sprintf( label, "%s : %s", GetEvent()->GetParameters(), GetEvent()->GetParameters2() );
	}
	else
	{
		strcpy( label, GetEvent()->GetParameters() );
	}

	return label;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:18,代码来源:choreoeventwidget.cpp


示例5: SetBoolYAMLValue

void SetBoolYAMLValue(bool *dest, char *key, ctr_yaml_context *ctx)
{
	GetEvent(ctx);
	if(ctx->error || ctx->done) return;
	if(!EventIsScalar(ctx)){
		fprintf(stderr,"[RSF ERROR] '%s' requires a value\n",key);
		ctx->error = YAML_BAD_FORMATTING;
		return;
	}
	if(!GetYamlStringSize(ctx)){
		fprintf(stderr,"[RSF ERROR] '%s' requires a value\n",key);
		ctx->error = YAML_BAD_FORMATTING;
		return;
	}
	
	if(casecmpYamlValue("true",ctx))
		*dest = true;
	else if(casecmpYamlValue("false",ctx))
		*dest = false;
	else{
		fprintf(stderr,"[RSF ERROR] Invalid '%s'\n",key);
		ctx->error = YAML_BAD_FORMATTING;
	}
	
	return;
	
}
开发者ID:44670,项目名称:Project_CTR,代码行数:27,代码来源:yaml_parser.c


示例6: SetSimpleYAMLValue

void SetSimpleYAMLValue(char **dest, char *key, ctr_yaml_context *ctx, u32 size_limit)
{
	if(*dest){
		fprintf(stderr,"[RSF ERROR] Item '%s' is already set\n",key);
		ctx->error = YAML_MEM_ERROR;
		return;
	}

	GetEvent(ctx);
	if(ctx->error || ctx->done) return;
	if(!EventIsScalar(ctx)){
		fprintf(stderr,"[RSF ERROR] '%s' requires a value\n",key);
		ctx->error = YAML_BAD_FORMATTING;
		return;
	}
	if(!GetYamlStringSize(ctx)) return;
	
	u32 size = GetYamlStringSize(ctx);
	if(size > size_limit && size_limit) size = size_limit;
	

	char *tmp = *dest;
	tmp = malloc(size+2);
	if(!tmp) {
		ctx->error = YAML_MEM_ERROR;
		return;
	}
	memset(tmp,0,size+2);
	memcpy(tmp,GetYamlString(ctx),size);	
	
	//printf("Setting %s to %s (size of %d)\n",key,GetYamlString(ctx),size);
	//printf("Check: %s & %x\n",tmp,tmp);
	*dest = tmp;
	
}
开发者ID:44670,项目名称:Project_CTR,代码行数:35,代码来源:yaml_parser.c


示例7: GetString

bool WizardApp::SetString( const wchar_t* lpSection, const wchar_t* lpKey, const wchar_t* lpValue )
{
	std::wstring strCurValue;
	GetString(lpSection, lpKey, strCurValue, L"{EA93CC4C-E460-4465-AEC9-57F2A8A348E1}");

	bool changed = false;
	if (lpValue != NULL)
	{
		if (strCurValue != lpValue)
		{
			changed = true;
		}
	}
	else
	{
		if (!strCurValue.empty())
		{
			changed = true;
		}
	}

	if (changed)
	{
		::WritePrivateProfileString(lpSection, lpKey, lpValue, m_strConfig.c_str());

		GetEvent()->FireConfigChange(lpSection, lpKey, lpValue);
	}

	return true;
}
开发者ID:Emily8713,项目名称:BOLT_SDK,代码行数:30,代码来源:WizardApp.cpp


示例8: GetEvent

void CChoreoGlobalEventWidget::DrawLabel( CChoreoWidgetDrawHelper& drawHelper, COLORREF clr, int x, int y, bool right )
{
	CChoreoEvent *event = GetEvent();
	if ( !event )
		return;

	int len = drawHelper.CalcTextWidth( "Arial", 9, FW_NORMAL, va( "%s", event->GetName() ) );

	RECT rcText;
	rcText.top = y;
	rcText.bottom = y + 10;
	rcText.left = x - len / 2;
	rcText.right = rcText.left + len;

	if ( !right )
	{
		drawHelper.DrawColoredTextCharset( "Marlett", 9, FW_NORMAL, SYMBOL_CHARSET, clr, rcText, "3" );
		OffsetRect( &rcText, 8, 0 );
		drawHelper.DrawColoredText( "Arial", 9, FW_NORMAL, clr, rcText, va( "%s", event->GetName() ) );
	}
	else
	{
		drawHelper.DrawColoredText( "Arial", 9, FW_NORMAL, clr, rcText, va( "%s", event->GetName() ) );
		OffsetRect( &rcText, len, 0 );
		drawHelper.DrawColoredTextCharset( "Marlett", 9, FW_NORMAL, SYMBOL_CHARSET, clr, rcText, "4" );
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:27,代码来源:choreoglobaleventwidget.cpp


示例9: while

/*
===============
idEventLoop::RunEventLoop
===============
*/
int idEventLoop::RunEventLoop( bool commandExecution )
{
	sysEvent_t	ev;
	
	while( 1 )
	{
	
		if( commandExecution )
		{
			// execute any bound commands before processing another event
			cmdSystem->ExecuteCommandBuffer();
		}
		
		ev = GetEvent();
		
		// if no more events are available
		if( ev.evType == SE_NONE )
		{
			return 0;
		}
		ProcessEvent( ev );
	}
	
	return 0;	// never reached
}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:30,代码来源:EventLoop.cpp


示例10: Flash

static void Flash()
{
#if 0               // FIXME
    FILE *animf;
    TEvent e;

    VVF_DrawFrame = DrawFlash;
    animf = GetAnimFile("flash");
    do {GetEvent(&e);} while (e.What != evNothing);
    DoneTimer();
    PlayVVF(animf);
    InitTimer();
    do {GetEvent(&e);} while (e.What != evNothing);
    fclose(animf);
#endif
}
开发者ID:danvac,项目名称:signus,代码行数:16,代码来源:mainmenu.cpp


示例11: MainLoop

void MainLoop(Display *display)
{
    Event *e = NULL;
    while ((e = GetEvent(display))) {
        callbacks_call(display->callbacks, display, e);
    }
}
开发者ID:cafiend,项目名称:W12,代码行数:7,代码来源:hlib.c


示例12: nacl_processevents

static void nacl_processevents(int wait, int* mx, int* my, int* mb, int* k) {
  static unsigned int mousebuttons = 0;
  static unsigned int mousex = 100;
  static unsigned int mousey = 0;
  static int iflag = 0; /* FIXEM*/

  struct PpapiEvent* event = GetEvent(wait);
  if (event != NULL) {
    /* only support mouse events for now */
    switch (event->type) {
      default:
        break;
      case PP_INPUTEVENT_TYPE_MOUSEDOWN:
        mousebuttons |= ButtonToMask(event->button);
        break;
      case PP_INPUTEVENT_TYPE_MOUSEUP:
        mousebuttons &= ~ButtonToMask(event->button);
        break;
      case PP_INPUTEVENT_TYPE_MOUSEMOVE:
        mousex = event->position.x;
        mousey = event->position.y;
        break;
    }
    free(event);
  }

  *mx = mousex;
  *my = mousey;
  *mb = mousebuttons;
  *k = iflag;
}
开发者ID:888,项目名称:naclports,代码行数:31,代码来源:ui_nacl.c


示例13: GetEvent

void CalendarMgr::SendCalendarEventInvite(CalendarInvite const& invite)
{
    CalendarEvent* calendarEvent = GetEvent(invite.GetEventId());
    time_t statusTime = invite.GetStatusTime();
    bool hasStatusTime = statusTime != 946684800;   // 01/01/2000 00:00:00

    ObjectGuid invitee = invite.GetInviteeGUID();
    Player* player = ObjectAccessor::FindConnectedPlayer(invitee);

    uint8 level = player ? player->getLevel() : sCharacterCache->GetCharacterLevelByGuid(invitee);

    WorldPacket data(SMSG_CALENDAR_EVENT_INVITE, 8 + 8 + 8 + 1 + 1 + 1 + (4) + 1);
    data << invitee.WriteAsPacked();
    data << uint64(invite.GetEventId());
    data << uint64(invite.GetInviteId());
    data << uint8(level);
    data << uint8(invite.GetStatus());
    data << uint8(hasStatusTime);
    if (hasStatusTime)
        data.AppendPackedTime(statusTime);
    data << uint8(invite.GetSenderGUID() != invite.GetInviteeGUID()); // false only if the invite is sign-up

    if (!calendarEvent) // Pre-invite
    {
        if (Player* playerSender = ObjectAccessor::FindConnectedPlayer(invite.GetSenderGUID()))
            playerSender->SendDirectMessage(&data);
    }
    else
    {
        if (calendarEvent->GetCreatorGUID() != invite.GetInviteeGUID()) // correct?
            SendPacketToAllEventRelatives(data, *calendarEvent);
    }
}
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:33,代码来源:CalendarMgr.cpp


示例14: GetNumEvents

bool CChoreoChannel::GetSortedCombinedEventList( char const *cctoken, CUtlRBTree< CChoreoEvent * >& events )
{
	events.RemoveAll();

	int i;
	// Sort items
	int c = GetNumEvents();
	for ( i = 0; i < c; i++ )
	{
		CChoreoEvent *e = GetEvent( i );
		Assert( e );
		if ( e->GetType() != CChoreoEvent::SPEAK )
			continue;

		if ( e->GetCloseCaptionType() == CChoreoEvent::CC_DISABLED )
			continue;

		// A master with no slaves is not a combined event
		if ( e->GetCloseCaptionType() == CChoreoEvent::CC_MASTER &&
			 e->GetNumSlaves() == 0 )
			 continue;

		char const *token = e->GetCloseCaptionToken();
		if ( Q_stricmp( token, cctoken ) )
			continue;

		events.Insert( e );
	}

	return ( events.Count() > 0 ) ? true : false;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:31,代码来源:choreochannel.cpp


示例15: tempInstance

	FMOD::Studio::EventInstance* SoundManager::GetSound( std::string eventID )
	{
		FMOD::Studio::EventInstance* tempInstance(nullptr);
//		ERRCHECK( GetEvent( eventID )->createInstance( &tempInstance ) );
		GetEvent( eventID )->createInstance( &tempInstance );
		return tempInstance;
	}
开发者ID:NHNNEXT,项目名称:2014-01-HUDIGAME-PoopTube,代码行数:7,代码来源:SoundManager.cpp


示例16: element

void ObjectBase::SerializeObject( ticpp::Element* serializedElement )
{
	ticpp::Element element( "object" );
	element.SetAttribute( "class", _STDSTR( GetClassName() ) );
	element.SetAttribute( "expanded", GetExpanded() );

	for ( unsigned int i = 0; i < GetPropertyCount(); i++ )
	{
		PProperty prop = GetProperty( i );
		ticpp::Element prop_element( "property" );
		prop_element.SetAttribute( "name", _STDSTR( prop->GetName() ) );
		prop_element.SetText( _STDSTR( prop->GetValue() ) );
		element.LinkEndChild( &prop_element );
	}

	for ( unsigned int i = 0; i < GetEventCount(); i++ )
	{
		PEvent event = GetEvent( i );
		ticpp::Element event_element( "event" );
		event_element.SetAttribute( "name", _STDSTR( event->GetName() ) );
		event_element.SetText( _STDSTR( event->GetValue() ) );
		element.LinkEndChild( &event_element );
	}

	for ( unsigned int i = 0 ; i < GetChildCount(); i++ )
	{
		PObjectBase child = GetChild( i );
		ticpp::Element child_element;
		child->SerializeObject( &child_element );
		element.LinkEndChild( &child_element );
	}

	*serializedElement = element;
}
开发者ID:heyuqi,项目名称:wxFormBuilder,代码行数:34,代码来源:objectbase.cpp


示例17: test_t2_instance

/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_t2_instance(void)
{
	StatusType result_inst_0, result_inst_1, result_inst_3, result_inst_4, result_inst_5;
	EventMaskType result_inst_2;
	
	SCHEDULING_CHECK_INIT(1);
	result_inst_0 = ActivateTask(t1);
	SCHEDULING_CHECK_AND_EQUAL_INT(1,E_OK, result_inst_0);
	
	SCHEDULING_CHECK_INIT(2);
	result_inst_1 = SetEvent(t1, Event1);
	SCHEDULING_CHECK_AND_EQUAL_INT(2,E_OK, result_inst_1);
		
	SCHEDULING_CHECK_INIT(3);
	result_inst_3 = GetEvent(t1,&result_inst_2);
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(3,Event1, result_inst_2);
	SCHEDULING_CHECK_AND_EQUAL_INT(3,E_OK, result_inst_3);
	
	SCHEDULING_CHECK_INIT(4);
	result_inst_4 = WaitEvent(Event2);
	SCHEDULING_CHECK_AND_EQUAL_INT(13,E_OK, result_inst_4);
	
	SCHEDULING_CHECK_INIT(14);
	result_inst_5 = TerminateTask();
	SCHEDULING_CHECK_AND_EQUAL_INT(14,E_OK, result_inst_5);
	
}
开发者ID:1984c,项目名称:trampoline,代码行数:29,代码来源:task2_instance.c


示例18: CreateListColumns

void pgRule::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane)
{
	if (properties)
	{
		CreateListColumns(properties);
		wxString def = GetFormattedDefinition();
		if (!def.IsEmpty())
		{
			int doPos = def.Find(wxT(" DO INSTEAD "));
			if (doPos > 0)
				def = def.Mid(doPos + 12).Strip(wxString::both);
			else
			{
				doPos = def.Find(wxT(" DO "));
				if (doPos > 0)
					def = def.Mid(doPos + 4).Strip(wxString::both);
			}
		}

		properties->AppendItem(_("Name"), GetName());
		properties->AppendItem(_("OID"), GetOid());
		properties->AppendItem(_("Event"), GetEvent());
		properties->AppendItem(_("Condition"), GetCondition());
		properties->AppendYesNoItem(_("Do instead?"), GetDoInstead());
		properties->AppendItem(_("Definition"), firstLineOnly(def));
		if (this->GetDatabase()->connection()->BackendMinimumVersion(8, 3))
			properties->AppendYesNoItem(_("Enabled?"), GetEnabled());
		properties->AppendYesNoItem(_("System rule?"), GetSystemObject());
		properties->AppendItem(_("Comment"), firstLineOnly(GetComment()));
	}
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:31,代码来源:pgRule.cpp


示例19: test_pretask_instance2

/*test case:test the reaction of the system called with 
 an activation of a task*/
static void test_pretask_instance2(void)
{
	StatusType result_inst_1, result_inst_2, result_inst_3, result_inst_4, result_inst_5;
	TaskType task_id;
	TaskStateType task_state;
	EventMaskType event_mask;
	AlarmBaseType alarm_base;
	TickType tik;
	
	SCHEDULING_CHECK_INIT(15);
	result_inst_1 = GetTaskID(&task_id);
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(15,INVALID_TASK , task_id); 
	SCHEDULING_CHECK_AND_EQUAL_INT(15,E_OK , result_inst_1); 
	
	SCHEDULING_CHECK_INIT(16);
	result_inst_2 = GetTaskState(task_id, &task_state);
	SCHEDULING_CHECK_AND_EQUAL_INT(17,E_OS_ID , result_inst_2);
	
	SCHEDULING_CHECK_INIT(18);
	result_inst_3 = GetEvent(task_id,&event_mask);
	SCHEDULING_CHECK_AND_EQUAL_INT(19,E_OS_ID , result_inst_3);
	
	SCHEDULING_CHECK_INIT(20);
	result_inst_4 = GetAlarmBase(Alarm1, &alarm_base);
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(20,OSMAXALLOWEDVALUE_Counter1, (int)(alarm_base.maxallowedvalue));
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(20,OSTICKSPERBASE_Counter1, (int)(alarm_base.ticksperbase));
	SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(20,OSMINCYCLE_Counter1, (int)(alarm_base.mincycle));
	SCHEDULING_CHECK_AND_EQUAL_INT(20,E_OK , result_inst_4);
	
	SCHEDULING_CHECK_INIT(21);
	result_inst_5 = GetAlarm(Alarm1,&tik);
	SCHEDULING_CHECK_AND_EQUAL_INT(21,E_OK , result_inst_5);
}
开发者ID:TrampolineRTOS,项目名称:trampoline,代码行数:35,代码来源:pretask_instance2.c


示例20: BriefGo

void BriefGo(char *MissionName)
{
    SetConstants();
    LinksSeq[0] = (char*)memalloc(8);
    
    strcpy(LinksSeq[0], MissionName);
    
    BriefInit(LinksSeq[0]);

  DrawOnScreen(1);
  FadeIn(Palette, 0);
  
  int BriefEvent; 
    // -7: Exit, -4: Up, -3: Down, -2: PgUp, -1: PgDown, 1..n: Odkazy HT
    do {
      BriefEvent = BriefGetEvent();
      BriefHandleEvent(BriefEvent);
  } while (BriefEvent != -7);
  
    BriefDone();
    FadeOut(Palette, 0);
    {
        TEvent e;
        do {GetEvent(&e);} while (e.What != evNothing);
    }
}
开发者ID:danvac,项目名称:signus,代码行数:26,代码来源:briefing.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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