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


C++ IEvent类代码示例

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


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

示例1: while

//	Return TRUE if the contact never received any message (which means the contact may need an invitation)
//	Return FALSE if there is at least one message received (which means both parties have communicated successfully)
BOOL
TContact::Contact_FIsInvitationRecommended()
	{
	if ((m_uFlagsContact & FC_kfContactNeedsInvitation) == 0)
		return FALSE;
	if (m_paVaultEvents != NULL)
		{
		// Search the entire Chat Log to find any message received.  Of course this is not the most optimal code, however the Chat Log should be rather short if there has been no communication between the two parties.
		IEvent ** ppEventStop;
		IEvent ** ppEvent = m_paVaultEvents->m_arraypaEvents.PrgpGetEventsStop(OUT &ppEventStop);
		while (ppEvent != ppEventStop)
			{
			IEvent * pEvent = *--ppEventStop;
			AssertValidEvent(pEvent);
			EEventClass eEventClass = pEvent->EGetEventClass();
			if ((eEventClass == eEventClass_eMessageTextSent && pEvent->Event_FHasCompleted()) ||	// If the message was sent successfully (with a confirmation receipt), then there is no need to send an invitation because the remote contact has the JID of the account
				(eEventClass & eEventClass_kfReceivedByRemoteClient))								// Anything received by the remote client means there has been a communication between the two contacts, and therefore there is no need to send an invitaiton
				{
				m_uFlagsContact &= ~FC_kfContactNeedsInvitation;	// Remove the invitation flag
				return FALSE;
				}
			} // while
		} // if
	return TRUE;
	}
开发者ID:tcolussi,项目名称:Cambrian-src,代码行数:27,代码来源:WLayoutChatLog.cpp

示例2: while

void CEventManager::ProcessEvents()
{
	while(!m_cEventList.empty())
	{
		IEvent* pEvent = *m_cEventList.begin();

		// Remove from the list now to avoid problems with sorting new events
		m_cEventList.erase(m_cEventList.begin());

		// Make range of listeners for the current event
		pair<EventIter, EventIter> range;
		range = m_cListeners.equal_range(pEvent->GetEventID());


		for(EventIter cMapIter = range.first; cMapIter != range.second; 
			cMapIter++)
		{
			// Call the callback function of each listener listening for this
			// event
			//if(cMapIter->second->m_pcListener->GetIsActive())
			{
				cMapIter->second->m_pfCallback(pEvent, 
					cMapIter->second->m_pcListener);
			}
		}

		// clean up the event's memory
		MMDELEVENT(pEvent);

		// Unregister any events
		UnregisterEvents();
	}
}	
开发者ID:TheGoctor,项目名称:falconfish-scd,代码行数:33,代码来源:CEventManager.cpp

示例3: enableEvent

	void enableEvent(const std::string& eventName) {
		IEvent* event = findEvent(eventName);

		if (event != NULL) {
			event->setEnabled(true);
		}
	}
开发者ID:chrisglass,项目名称:ufoai,代码行数:7,代码来源:EventManager.cpp

示例4: Update

int		Ncurses::run(IEvent &eventManager)
{
    int	pb;

    Update();
    timeout(_timeout);
    while ((pb = getch()) != 'q' || pb != KEY_ESC)
    {
        switch (pb)
        {
        case KEY_LEFT :
        {
            eventManager.KeyLeft();
            break;
        }
        case KEY_RIGHT :
        {
            eventManager.KeyRight();
            break;
        }
        case KEY_ESC :
        {
            eventManager.KeyEschap();
            break;
        }
        }
        eventManager.ChooseEvent();
    }
    return (1);
}
开发者ID:mushishi06,项目名称:epitech_perso,代码行数:30,代码来源:Ncurses.cpp

示例5: ChGetCambrianActionFromUrl

void
WChatLog::SL_HyperlinkMouseHovering(const QUrl & url)
	{
	CStr strTip;
	QString sUrl = url.toString();
	CStr strUrl = sUrl;		// Convert the URL to UTF-8
	PSZUC pszUrl = strUrl;
	if (FIsSchemeCambrian(pszUrl))
		{
		const CHS chCambrianAction = ChGetCambrianActionFromUrl(pszUrl);
		if (chCambrianAction == d_chCambrianAction_None)
			{
			TIMESTAMP tsEventID;
			PSZUC pszAction = Timestamp_PchDecodeFromBase64Url(OUT &tsEventID, pszUrl + 2);
			Assert(pszAction[0] == d_chSchemeCambrianActionSeparator);
			IEvent * pEvent = m_pContactOrGroup->Vault_PFindEventByID(tsEventID);
			if (pEvent != NULL)
				pEvent->HyperlinkGetTooltipText(pszAction + 1, IOUT &strTip);
			else
				MessageLog_AppendTextFormatSev(eSeverityErrorWarning, "WChatLog::SL_HyperlinkMouseHovering() - Unable to find matching tsEventID $t from hyperlink $s\n", tsEventID, pszUrl);
			} // if
		sUrl = strTip.ToQString();
		}
	QToolTip::showText(QCursor::pos(), sUrl, this);
	} // SL_HyperlinkMouseHovering()
开发者ID:voodoo-chile,项目名称:Cambrian-src,代码行数:25,代码来源:WChatLog.cpp

示例6: dispatchHandlerEvent

Boolean DetailsTreeHandler :: dispatchHandlerEvent ( IEvent& evt)
{
  if(evt.eventId() == WM_PRESPARAMCHANGED)
  {
     if(evt.parameter1() == PP_FONTNAMESIZE ||
        evt.parameter1() == PP_FONTHANDLE)
        return fontChanged(evt);
  }
  return Inherited::dispatchHandlerEvent(evt);
}
开发者ID:OS2World,项目名称:DEV-SAMPLES-CPP-OS2-CPP-Class_Lib,代码行数:10,代码来源:TREEDETH.CPP

示例7: GTK_WIDGET

	/* Checks the passed xmlNode for a recognized item (ToolButton, ToggleToolButton, Separator)
	 * Returns the widget or NULL if nothing useful is found
	 */
	GtkWidget* ToolbarCreator::createToolItem(xml::Node& node, GtkToolbar* toolbar) {
		const std::string nodeName = node.getName();
		GtkWidget* toolItem;

		if (nodeName == "separator") {
			toolItem = GTK_WIDGET(gtk_separator_tool_item_new());
		}
		else if (nodeName == "toolbutton" || nodeName == "toggletoolbutton") {
			// Found a button, load the values that are shared by both types
			const std::string name 		= node.getAttributeValue("name");
			const std::string icon 		= node.getAttributeValue("icon");
			const std::string tooltip 	= _(node.getAttributeValue("tooltip").c_str());
			const std::string action 	= node.getAttributeValue("action");

			if (nodeName == "toolbutton") {
				// Create a new GtkToolButton and assign the right callback
				toolItem = GTK_WIDGET(gtk_tool_button_new(NULL, name.c_str()));

			}
			else {
				// Create a new GtkToggleToolButton and assign the right callback
				toolItem = GTK_WIDGET(gtk_toggle_tool_button_new());

			}

			IEvent* event = GlobalEventManager().findEvent(action);
			if (event != NULL) {
				event->connectWidget(GTK_WIDGET(toolItem));

				// Tell the event to update the state of this button
				event->updateWidgets();
			} else {
				globalErrorStream() << "ToolbarCreator: Failed to lookup command " << action << "\n";
			}

			// Set the tooltip, if not empty
			if (!tooltip.empty()) {
				gtk_tooltips_set_tip(_tooltips, GTK_WIDGET(toolItem), tooltip.c_str(), "");
				//gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(toolItem), _tooltips, tooltip.c_str(), "");
			}

			// Load and assign the icon, if specified
			if (icon != "") {
				GtkWidget* image = gtk_image_new_from_pixbuf(gtkutil::getLocalPixbufWithMask(icon));
				gtk_widget_show(image);
				gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(toolItem), image);
			}
		}
		else {
			return NULL;
		}

		gtk_widget_show(toolItem);
		return toolItem;
	}
开发者ID:AresAndy,项目名称:ufoai,代码行数:58,代码来源:ToolbarCreator.cpp

示例8: dispatchHandlerEvent

 virtual Boolean
   dispatchHandlerEvent ( IEvent &event )
   {
     Boolean stopProcessing = false;
     if (event.eventId() == 0x000F  &&   // WM_SETFOCUS
         event.parameter2().number1())   //   gaining focus
     {
        stopProcessing = true;
     }
     return stopProcessing;
   }
开发者ID:OS2World,项目名称:DEV-SAMPLES-CPP-OS2-CPP-Class_Lib,代码行数:11,代码来源:VPORTLOG.HPP

示例9: while

void DummyDevDA::executeOutputLoop() {
    this->outputLoopRunning = true;
    while (outputLoopRunning) {
        this->outputEventQueue.waitForData();
        IEvent * event = this->outputEventQueue.pop();
        if (event) {
            cout << "DummyDevDA: " << event->getEventTypeID() << " " << event << endl;
            //delete event;
        }
    }
}
开发者ID:lkulf,项目名称:tuiframework,代码行数:11,代码来源:DummyDevDA.cpp

示例10: DoEvent

 void EventManager::DoEvent(typeEventID theEventID,void* theContext)
 {
   std::map<const typeEventID, IEvent*>::const_iterator anIter =
     mList.find(theEventID);
   if (anIter != mList.end())
   {
     // Get the event to execute
     IEvent* anEvent = anIter->second;
     // Now call DoEvent for this event with theContext provided
     anEvent->DoEvent(theContext);
   }
 }
开发者ID:ItsJackson,项目名称:gqe,代码行数:12,代码来源:EventManager.cpp

示例11: epoll_wait

int SyncReactor::epollDispatch()
{
    int ret = 0;
    int num = epoll_wait(_epfd, _epev, _maxEvents, 3000); 
    Log::DEBUG("wait done %d", num);

    for(int i  = 0; i < num; i++)
    {
        IEvent *ev = static_cast<IEvent *>(_epev[i].data.ptr);
        
        int events = 0;
        if((_epev[i].events & EPOLLHUP) ||
            _epev[i].events & EPOLLERR)
        {
            Log::WARN("EPOLLHUP | EPOLLERR event happen in %d", _epev[i].data.fd);
            events = events | IEvent::CLOSESOCK;
        }

        if(_epev[i].events & EPOLLIN)
            events |= IEvent::IOREADABLE;
        if(_epev[i].events & EPOLLOUT)
            events |= IEvent::IOWRITEABLE;
        if(ev->result() & IEvent::ACCEPT) 
            events |= IEvent::ACCEPT;

        ev->setResult(events);
        if(events & IEvent::CLOSESOCK)
        {
            delete ev;
            continue;
        }
        if(events & IEvent::ACCEPT)
        {
            extEvent(ev);
            continue;
        }
        
        ret = epoll_ctl(_epfd, EPOLL_CTL_DEL, ev->handle(), NULL);
        if(ret < 0)
        {
            Log::WARN("del event fd from epoll error, %d : %s", ev->handle(), strerror(errno));
        }

        if(_extReactor != NULL)
            _extReactor->post(ev);
        else
            extEvent(ev);
    }
    return num;
}
开发者ID:RoyLzr,项目名称:nf_server,代码行数:50,代码来源:syncReactor.cpp

示例12: main

void MyMain::main (IEvent & event)               // Do in this effective main function whatever you want!
{

  IString s;                                     // Two values we want the user to input.
  double d;

  switch (event.parameter1())                    // Use this to define the different parts of your program
     {
     case cmdStartUp:                            // This part will be run when the program first comes up.

        cout = text.stream();                    // Assign the KrTextOutput object's stream to cout
        cout.setf (ios::unitbuf);                // Unfortunately, the above line does not copy this property

        s = "Old value of the string";           // Since the user will be offered to use the old values,
        d = 42;                                  //   those should be set to a sensible value.

        wcin << "Please enter a string here:" >> s;
                                                 // Ask for a string with this text explaining what to do...
        wcin << "...and a number here:" >> d     // ...and for a number.
             << display;                         // The display manipulator will display all the
                                                 //   queries we've made (in one dialog window)

        if (wcin.ok())                           // The result of the last dialog
           cout << "You pressed OK.\n";
        else
           cout << "You aborted the dialog.\n";

        cout << "  s = " << s << "\n  d = " << d;

        break;                                   // Our effective main program ends here.
     };
};
开发者ID:OS2World,项目名称:LIB-PM-Kronis_Classes,代码行数:32,代码来源:dialog.cpp

示例13: fontChanged

Boolean DetailsTreeHandler :: fontChanged(IEvent& evt)
{
  IFUNCTRACE_DEVELOP();
  IContainerControl* thisContainer = (IContainerControl*)evt.window();
  IContainerControl* otherContainer;

  if(thisContainer==treeCnr) {
    otherContainer = &(treeCnr->detailsContainer());
  }
  else {
    otherContainer = treeCnr;
  }


  // We need to keep track of the top level entry to this    
  // function so that we avoid a ping-pong affect that could 
  // occur between the two containers on font a change. This 
  // works since the font change notification is WinSent.    
  Boolean fNested = treeCnr->fontChangeStarted();
  treeCnr->setFontChangeStarted(true);


  if(!fNested) {
       IFont newFont(thisContainer);
       otherContainer->setFont(newFont);
       treeCnr->setFontChangeStarted(false);
  }
  return false;
}
开发者ID:OS2World,项目名称:DEV-SAMPLES-CPP-OS2-CPP-Class_Lib,代码行数:29,代码来源:TREEDETH.CPP

示例14: main

void MyMain::main (IEvent & event)               // Do in this effective main function whatever you want!
{

  switch (event.parameter1())                    // Use this to define the different parts of your program
     {
     case cmdStartUp:                            // This part will be run when the program first comes up.

        cout = text.stream();                    // Assign the KrTextOutput object's stream to cout
        cout.setf (ios::unitbuf);                // Unfortunately, the above line does not copy this property

        static KrBitfield bf;                    // Let the user click several options on/off independently
        int bf1 = bf.add ("Space");              // The int variables are used to identify the item later.
        int bf2 = bf.add ("Lots of Money");      // You may also define them a priori, but this is easier.
                                                 // All options are off by default, but his can be changed.

        static KrChoice ch;                      // Let the user choose exactly one of several choices.
        int ch1 = ch.add ("Betazoid");
        int ch2 = ch.add ("Klingon");
        ch.set (ch1);                            // One choice should be set as the default.

        wcin << "'Enterprise' has something to do with..." >> bf;
        wcin << "Deanna Troi is..." >> ch
             >> display;                         // The display manipulator will work with both
                                                 //   the >> and the << operator.

        cout << "Your choices:\n";
        cout << " 'Enterprise' has " << (bf.isChecked(bf1)?"something":"nothing") << " to do with Space\n";
        cout << " 'Enterprise' has " << (bf.isChecked(bf2)?"something":"nothing")
             << " to do with Lots of Money\n";
        cout << " Deanna Troi is " << (ch.get()==ch1?"Betazoid":"Klingon") << "\n";

        break;                                   // Our effective main program ends here.
     };
};
开发者ID:OS2World,项目名称:LIB-PM-Kronis_Classes,代码行数:34,代码来源:dialog2.cpp

示例15: while

  void EventManager::DoEvents(void* theContext)
  {
    std::map<const typeEventID, IEvent*>::const_iterator anIter =
      mList.begin();
    while(anIter != mList.end())
    {
      // Get the event to execute
      IEvent* anEvent = anIter->second;

      // Iterate to the next event
      anIter++;

      // Now call DoEvent for this event with theContext provided
      anEvent->DoEvent(theContext);
    }
  }
开发者ID:ItsJackson,项目名称:gqe,代码行数:16,代码来源:EventManager.cpp


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