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

C++ MakeDelegate函数代码示例

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

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



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

示例1: TEST

   TEST(ThreadBehavior, StartOnce)
   { 
      AutoPtr<PlatformFixture> fixture(new PlatformFixture);
      Thread::StartDelegate d(MakeDelegate(&dummy));
      Thread t(d);

      fixture->threadImpl->startSuccess = Threading::Status_NoError;
      //, "Expected that Thread::start() would succeed if ThreadImpl::start succeds"
      EXPECT_TRUE(t.start() == Threading::Status_NoError);
      //, "Expected that Thread::start() would fail if called a second time"
      EXPECT_TRUE(t.start() == Threading::Status_Again);
   }
开发者ID:justindujardin,项目名称:ACL,代码行数:12,代码来源:threadTests.cpp


示例2: UIElement

    /* Public */
    Camera::Camera(const Point2i &position, const Point2i &dimensions, const Point2i &frameDimensions, const Point2i &textureDimensions) :
        UIElement(position, dimensions)
    {
        this->frameDimensions = frameDimensions;
        
        int px = position.getX();
        int py = position.getY() + dimensions.getY() - CONTROL_BAR_HEIGHT;
        int dx = dimensions.getX() - 125;
        int dy = CONTROL_BAR_HEIGHT;
        
        controls = new CameraControls(Point2i(px, py), Point2i(dx, dy));
        controls->setClickedCallback(MakeDelegate(this, &Camera::controls_Clicked));
        registerEventHandler(controls);
        
        mode = new ModeToggle(Point2i(dx, py), Point2i(125, dy), "switch_slide.png", "switch_rub.png");
        mode->setClickedCallback(MakeDelegate(this, &Camera::mode_Clicked));
        registerEventHandler(mode);
        
        GLfloat data[12] =
		{
			0.0f, 0.0f, 0.0f,
			0.0f, 1.0f, 0.0f,
			1.0f, 0.0f, 0.0f,
			1.0f, 1.0f, 0.0f
		};

        float u0 = 0.0f;
        float u1 = (float)frameDimensions.getX() / (float)textureDimensions.getX();
        float v0 = 0.0f;// 
        float v1 = (float)frameDimensions.getY() / (float)textureDimensions.getY();
        GLfloat textureData[8] =
		{
			u0, v1,
			u1, v1,
			u0, v0,
			u1, v0
		};

        vbo = new GLVbo(GL_TRIANGLE_STRIP, GL_STATIC_DRAW, data, 4, textureData);
    }
开发者ID:jonathanhook,项目名称:PaintingRegistration,代码行数:41,代码来源:Camera.cpp


示例3: ColourPicker

	void WheelMenu::initMenuItems(void)
	{
		unsigned int width = dimensions.getX();

		sound = new ColourPicker(Sounds::getSounds(), "Sound", position, width);
		sound->setSelectionChangedCallback(MakeDelegate(this, &WheelMenu::sound_SelectionChanged));
		addMenuItem(*sound);

		size = new Slider("Size", position, width);
		size->setValueChangedCallback(MakeDelegate(this, &WheelMenu::size_ValueChanged));
		addMenuItem(*size);

		rate = new Slider("Rate", position, width);
		rate->setValueChangedCallback(MakeDelegate(this, &WheelMenu::rate_ValueChanged));
		addMenuItem(*rate);

		pattern = new PatternPicker(8, "Pattern", position, width);
		pattern->setPatternChangedCallback(MakeDelegate(this, &WheelMenu::pattern_PatternChanged));
		addMenuItem(*pattern);

		sync = new Button("Sync", position, width);
		sync->setClickedCallback(MakeDelegate(this, &WheelMenu::sync_Clicked));
		addMenuItem(*sync);

		if(mode == INSPECT)
		{
			erase = new Button("Erase", position, width);
			erase->setClickedCallback(MakeDelegate(this, &WheelMenu::erase_Clicked));
			addMenuItem(*erase);
		}
	}
开发者ID:jonathanhook,项目名称:PhysicsSynth,代码行数:31,代码来源:WheelMenu.cpp


示例4: cb

CTreeTab::CTreeTab(CPaintManagerUI* ppm)
{
	CDialogBuilder builder;
	CDialogBuilderCallbackEx cb (ppm);
	CContainerUI* pbtnTab = static_cast<CContainerUI*>(builder.Create(_T("tree.xml"), 0, &cb, ppm));
	if( pbtnTab ) {
		this->Add(pbtnTab);
	}
	else {
		this->RemoveAll();
		return;
	}

	CDuiTreeView* pTree1 = static_cast<CDuiTreeView*>(pbtnTab->FindSubControl(_T("Tree1")));
	pTree1->OnNotify += MakeDelegate(this,&CTreeTab::OnFolderChanged);
	if (pTree1) {
		pTree1->SetDepth(4);
		pTree1->SetExpandImage(_T("tree_expand.png"));
		CDuiTreeView::Node* pCategoryNode = NULL;
		CDuiTreeView::Node* pGameNode = NULL;
		CDuiTreeView::Node* pServerNode = NULL;
		CDuiTreeView::Node* pRoomNode = NULL;
		pCategoryNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 3}{x 4}ÍƼöÓÎÏ·"));
		for (int i = 0; i < 4; ++i)
		{
			pGameNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 10}{x 4}ËÄÈ˶·µØÖ÷"), pCategoryNode);
			for (int i = 0; i < 3; ++i)
			{
				pServerNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 10}{x 4}²âÊÔ·þÎñÆ÷"), pGameNode);
				for (int i = 0; i < 3; ++i)
				{
					pRoomNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 10}{x 4}²âÊÔ·¿¼ä"), pServerNode);
				}
			}
		}
		pCategoryNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 3}{x 4}×î½üÍæ¹ýµÄÓÎÏ·"));
		for (int i = 0; i < 2; ++i)
		{
			pTree1->AddNode(_T("Èýȱһ"), pCategoryNode);
		}
		pCategoryNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 3}{x 4}ÆåÅÆÓÎÏ·"));
		for (int i = 0; i < 8; ++i)
		{
			pTree1->AddNode(_T("Ë«¿Û"), pCategoryNode);
		}
		pCategoryNode = pTree1->AddNode(_T("{x 4}{i gameicons.png 18 3}{x 4}ÐÝÏÐÓÎÏ·"));
		for (int i = 0; i < 8; ++i)
		{
			pTree1->AddNode(_T("·ÉÐÐÆå"), pCategoryNode);
		}
	}
}
开发者ID:fmj1980,项目名称:duilib,代码行数:52,代码来源:TreeTab.cpp


示例5: udp_params

CamSyncReceiver::CamSyncReceiver() 
{
	udp_params params = udp_params();
	params.remote_ip = inet_addr(CAMSYNC_BROADCAST_IP);
	params.local_port = CAMSYNC_BROADCAST_PORT;
	params.reuse_addr = 1;
	conn = new udp_connection (params);	
	conn->set_callback (MakeDelegate(this,&CamSyncReceiver::UDPCallback),conn);	
	sequenceNumber=0;
	packetCount=0;
	dropCount=0;
	printf("Camera Sync RX Interface Initialized. %s:%d\r\n",CAMSYNC_BROADCAST_IP,CAMSYNC_BROADCAST_PORT);
}
开发者ID:b01901143,项目名称:ShowcaseRobotERIC,代码行数:13,代码来源:camSyncClient.cpp


示例6: MakeDelegate

	//************************************
	// 函数名称: AddAt
	// 返回类型: long
	// 参数信息: CTreeNodeUI * pControl
	// 参数信息: int iIndex
	// 函数说明: 该方法不会将待插入的节点进行缩位处理,若打算插入的节点为非根节点,请使用AddAt(CTreeNodeUI* pControl,CTreeNodeUI* _IndexNode) 方法
	//************************************
	long CTreeViewUI::AddAt( CTreeNodeUI* pControl, int iIndex )
	{
		if (!pControl)
			return -1;

		if (_tcsicmp(pControl->GetClass(), _T("TreeNodeUI")) != 0)
			return -1;

		CTreeNodeUI* pParent = static_cast<CTreeNodeUI*>(GetItemAt(iIndex));
		if(!pParent)
			return -1;

		pControl->OnNotify += MakeDelegate(this,&CTreeViewUI::OnDBClickItem);
		pControl->GetFolderButton()->OnNotify += MakeDelegate(this,&CTreeViewUI::OnFolderChanged);
		pControl->GetCheckBox()->OnNotify += MakeDelegate(this,&CTreeViewUI::OnCheckBoxChanged);

		pControl->SetVisibleFolderBtn(m_bVisibleFolderBtn);
		pControl->SetVisibleCheckBtn(m_bVisibleCheckBtn);

		if(m_uItemMinWidth > 0)
			pControl->SetMinWidth(m_uItemMinWidth);

		CListUI::AddAt(pControl,iIndex);

		if(pControl->GetCountChild() > 0)
		{
			int nCount = pControl->GetCountChild();
			for(int nIndex = 0;nIndex < nCount;nIndex++)
			{
				CTreeNodeUI* pNode = pControl->GetChildNode(nIndex);
				if(pNode)
					return AddAt(pNode,iIndex+1);
			}
		}
		else
			return iIndex+1;

		return -1;
	}
开发者ID:goodgo,项目名称:TradeClient,代码行数:46,代码来源:UITreeView.cpp


示例7: OnResume

 //-------------------------------------------------------
 //-------------------------------------------------------
 void Canvas::OnResume()
 {
     m_screenResizedConnection = m_screen->GetResolutionChangedEvent().OpenConnection(MakeDelegate(this, &Canvas::OnScreenResolutionChanged));
     
     auto pointerSystem = Application::Get()->GetSystem<PointerSystem>();
     m_pointerAddedConnection = pointerSystem->GetPointerAddedEvent().OpenConnection(MakeDelegate(this, &Canvas::OnPointerAdded));
     m_pointerDownConnection = pointerSystem->GetPointerDownEventInternal().OpenConnection(MakeDelegate(this, &Canvas::OnPointerDown));
     m_pointerMovedConnection = pointerSystem->GetPointerMovedEvent().OpenConnection(MakeDelegate(this, &Canvas::OnPointerMoved));
     m_pointerUpConnection = pointerSystem->GetPointerUpEvent().OpenConnection(MakeDelegate(this, &Canvas::OnPointerUp));
     m_pointerRemovedConnection = pointerSystem->GetPointerRemovedEvent().OpenConnection(MakeDelegate(this, &Canvas::OnPointerRemoved));
     
     m_canvas->OnResume();
 }
开发者ID:AzCopey,项目名称:ChilliSource,代码行数:15,代码来源:Canvas.cpp


示例8: udp_params

RoadFitterInterfaceReceiver::RoadFitterInterfaceReceiver() 
{
	udp_params params = udp_params();
	params.remote_ip = inet_addr(UDP_RF_MULTICAST_ADDR);
	params.local_port = UDP_RF_PORT;
	params.reuse_addr = 1;
	conn = new udp_connection (params);	
	conn->set_callback (MakeDelegate(this,&RoadFitterInterfaceReceiver::UDPCallback),conn);	
	sequenceNumber=0;
	packetCount=0;
	dropCount=0;
	printf("Road Fitter RX Interface Initialized. %s:%d\r\n",UDP_RF_MULTICAST_ADDR,UDP_RF_PORT);
}
开发者ID:FrozenXZeus,项目名称:cornell-urban-challenge,代码行数:13,代码来源:roadFitterInterface.cpp


示例9: OutputDebugString

void Process::HandleUnderlyingListingDone(  ) {

  m_ss.str( "" );
  m_ss << "Underlying Contract Done" << std::endl;
  OutputDebugString( m_ss.str().c_str() );

  m_db.SetOnNewInstrumentHandler( MakeDelegate( this, &Process::HandleStrikeFromDb ) );
  if ( m_db.LoadOptions( m_pUnderlying, m_dExpiry.year(), m_dExpiry.month(), m_dExpiry.day() ) ) {
    // options have been loaded through HandleStrikeFromDb
    HandleStrikeListingDone();
  }
  else {
    // request contract info for strike listing 
    m_contract.secType = "OPT";
    //m_contract.right = "CALL";  // get all calls and puts together
    m_tws->SetOnContractDetailsHandler( MakeDelegate( this, &Process::HandleStrikeFromIB ) );
    m_tws->SetOnContractDetailsDoneHandler( MakeDelegate( this, &Process::HandleStrikeListingDone ) );
    m_tws->RequestContractDetails( m_contract );
  }
  m_db.SetOnNewInstrumentHandler( 0 );
  
}
开发者ID:rburkholder,项目名称:trade-frame,代码行数:22,代码来源:Process.cpp


示例10: MakeDelegate

/// Choose a player's next tech research project
TechTypes CvTechAI::ChooseNextTech(bool bFreeTech)
{
	RandomNumberDelegate fcn;
	TechTypes rtnValue = NO_TECH;
	int iTechLoop;

	// Use the synchronous random number generate
	// Asynchronous one would be:
	//	fcn = MakeDelegate (&GC.getGame(), &CvGame::getAsyncRandNum);
	fcn = MakeDelegate(&GC.getGame(), &CvGame::getJonRandNum);

	// Create a new vector holding only techs we can currently research
	m_ResearchableTechs.clear();

	// Loop through adding the researchable techs
	for(iTechLoop = 0; iTechLoop < m_pCurrentTechs->GetTechs()->GetNumTechs(); iTechLoop++)
	{
		if(m_pCurrentTechs->CanResearch((TechTypes)iTechLoop))
		{
			// For free techs, need an additional check
			if(bFreeTech)
			{
				if(m_pCurrentTechs->CanResearchForFree((TechTypes)iTechLoop))
				{
					m_ResearchableTechs.push_back(iTechLoop, m_TechAIWeights.GetWeight(iTechLoop));
				}
			}
			else
			{
				m_ResearchableTechs.push_back(iTechLoop, m_TechAIWeights.GetWeight(iTechLoop));
			}
		}
	}

	// Reweight our possible choices by their cost, but only if cost is actually a factor!
	if(!bFreeTech)
		ReweightByCost();

	m_ResearchableTechs.SortItems();
	LogPossibleResearch();

	// If total weight is above 0, choose one above a threshold
	if(m_ResearchableTechs.GetTotalWeight() > 0)
	{
		int iNumChoices =GC.getGame().getHandicapInfo().GetTechNumOptions();
		rtnValue = (TechTypes) m_ResearchableTechs.ChooseFromTopChoices(iNumChoices, &fcn, "Choosing tech from Top Choices");
		LogResearchChoice(rtnValue);
	}

	return rtnValue;
}
开发者ID:Be1eriand,项目名称:Civ5-DLL,代码行数:52,代码来源:CvTechAI.cpp


示例11: timer

        void NLayout::RelayoutChilds()
        {
            if(!IsLayoutable())
                return;

            if(innerFrame_ == NULL)
                return;

            if(delayRelayoutChilds_)
                return;

            Base::NInstPtr<NTimerSrv> timer(MemToolParam);
            delayRelayoutChilds_ = timer->startOnceTimer(10, MakeDelegate(this, &NLayout::RelayoutChildsImpl));
        }
开发者ID:hufuman,项目名称:nui,代码行数:14,代码来源:NLayoutImpl.cpp


示例12: GetVertScroll

        NScroll* NLayout::GetVertScroll()
        {
            if(!scrollAllowed_)
                return NULL;

            if(vertScroll_)
                return vertScroll_;
            vertScroll_.Create(MemToolParam);
            vertScroll_->SetVisible(false);
            vertScroll_->Create(this, _NUI_VERT_SCROLL_ID_, NFrame::LayoutVFill | NFrame::LayoutRight, NULL);
            vertScroll_->SetScrollType(false);
            vertScroll_->ScrollEvent.AddHandler(MakeDelegate(this, &NLayout::OnVertScrolled));
            return vertScroll_;
        }
开发者ID:hufuman,项目名称:nui,代码行数:14,代码来源:NLayoutImpl.cpp


示例13: MakeDelegate

void CVuChartArmsIntraDay::HandleRealTime() {
  if ( theApp.m_bLive ) {
//    CIQFeedSymbol *pSym;

    char symIndu[] = "INDU.X";
    m_IQFeedProvider.GetIQFeedProvider()->AddTradeHandler( symIndu, MakeDelegate( this, &CVuChartArmsIntraDay::ProcessMergeIndu ) );
    //pSym = theApp.m_pIQFeed->Attach( symIndu );
    //pSym->OnUpdateMessage.Add( MakeDelegate( this, &CVuChartArmsIntraDay::HandleInduUpdate ) );
    //theApp.m_pIQFeed->Watch( symIndu );

    char symTrin[] = "TRIN.Z";
    m_IQFeedProvider.GetIQFeedProvider()->AddTradeHandler( symTrin, MakeDelegate( this, &CVuChartArmsIntraDay::ProcessMergeTrin ) );
    //pSym = theApp.m_pIQFeed->Attach( symTrin );
    //pSym->OnUpdateMessage.Add( MakeDelegate( this, &CVuChartArmsIntraDay::HandleTrinUpdate ) );
    //theApp.m_pIQFeed->Watch( symTrin );

    char symTick[] = "TICK.Z";
    m_IQFeedProvider.GetIQFeedProvider()->AddTradeHandler( symTick, MakeDelegate( this, &CVuChartArmsIntraDay::ProcessMergeTick ) );
    //pSym = theApp.m_pIQFeed->Attach( symTick );
    //pSym->OnUpdateMessage.Add( MakeDelegate( this, &CVuChartArmsIntraDay::HandleTickUpdate ) );
    //theApp.m_pIQFeed->Watch( symTick );
  }
}
开发者ID:rburkholder,项目名称:trade-frame,代码行数:23,代码来源:VuChartArmsIntraDay.cpp


示例14: GetHorzScroll

        NScroll* NLayout::GetHorzScroll()
        {
            if(!scrollAllowed_)
                return NULL;

            if(horzScroll_)
                return horzScroll_;
            horzScroll_.Create(MemToolParam);
            horzScroll_->SetVisible(false);
            horzScroll_->Create(this, _NUI_HORZ_SCROLL_ID_, NFrame::LayoutHFill | NFrame::LayoutBottom, NULL);
            horzScroll_->SetScrollType(true);
            horzScroll_->ScrollEvent.AddHandler(MakeDelegate(this, &NLayout::OnHorzScrolled));
            return horzScroll_;
        }
开发者ID:hufuman,项目名称:nui,代码行数:14,代码来源:NLayoutImpl.cpp


示例15: InputOutputWindow

QueryWindow::QueryWindow(Session *pSession,
                         QExplicitlySharedDataPointer<ServerConnectionPanel> pSharedServerConnPanel,
                         const QString &targetNick)
    : InputOutputWindow(targetNick)
{
    m_pSession = pSession;
    m_pSharedServerConnPanel = pSharedServerConnPanel;
    m_targetNick = targetNick;

    m_pVLayout->addWidget(m_pOutput);
    m_pVLayout->addWidget(m_pInput);
    m_pVLayout->setSpacing(5);
    m_pVLayout->setContentsMargins(2, 2, 2, 2);
    setLayout(m_pVLayout);

    m_pOpenButton = m_pSharedServerConnPanel->addOpenButton(m_pOutput, "Connect", 80, 30);
    m_pOutput->installEventFilter(this);

    g_pEvtManager->hookEvent("numericMessage", m_pSession, MakeDelegate(this, &QueryWindow::onNumericMessage));
    g_pEvtManager->hookEvent("nickMessage",    m_pSession, MakeDelegate(this, &QueryWindow::onNickMessage));
    g_pEvtManager->hookEvent("noticeMessage",  m_pSession, MakeDelegate(this, &QueryWindow::onNoticeMessage));
    g_pEvtManager->hookEvent("privmsgMessage", m_pSession, MakeDelegate(this, &QueryWindow::onPrivmsgMessage));
}
开发者ID:blockchain-research-foundation,项目名称:pebblecoin,代码行数:23,代码来源:QueryWindow.cpp


示例16: _T

void CMyList::Init(CPaintManagerUI* ppm)
{
	CDialogBuilder builder;
	CContainerUI* pList = static_cast<CContainerUI*>(builder.Create(_T("mylist.xml"), 0, NULL, ppm));
	if( pList != NULL ) {
		for(int i = 0; i < 100; ++i) 
		{
			if( pList == NULL ) pList = static_cast<CContainerUI*>(builder.Create());
			if( pList != NULL ) {
				this->Add(pList);
				TCHAR indexBuffer[16];
				CDuiString strIndexString = _T("- ");
				strIndexString += _itot(i+1, indexBuffer, 10);
				strIndexString += _T(" -");
				pList->GetItemAt(0)->SetText(strIndexString);

				CComboUI* pCombo = static_cast <CComboUI*> (pList->GetItemAt(1));
				if (pCombo != NULL) {
					for (int j = 0; j < 3; ++j) {
						CListLabelElementUI* pComboItem = new CListLabelElementUI;
						pComboItem->SetText("xxx");
						pCombo->Add(pComboItem);
					}
				}
				pList->GetItemAt(0)->OnEvent += MakeDelegate (this, &CMyList::OnTheEvent);
				pList->GetItemAt(1)->OnEvent += MakeDelegate (this, &CMyList::OnTheEvent);
				pList->GetItemAt(2)->OnEvent += MakeDelegate (this, &CMyList::OnTheEvent);
				pList->OnEvent += MakeDelegate (this, &CMyList::OnTheEvent);
				pList = NULL;
			}
			else {
				this->RemoveAll();
				return;
			}
		}
	}
}
开发者ID:fmj1980,项目名称:duilib,代码行数:37,代码来源:MyList.cpp


示例17: DoubleSideStackAllocatorTest

 DoubleSideStackAllocatorTest()
 :TestSuite("RadonFramework::Memory::DoubleSideStack-Test")
 {
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::Constructor),
         "DoubleSideStackAllocatorTest::Constructor", "Constructor");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::ClearBoth),
         "DoubleSideStackAllocatorTest::ClearBoth", "ClearBoth");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::PushPersistant),
         "DoubleSideStackAllocatorTest::PushPersistant", "PushPersistant");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::PushTemporary),
         "DoubleSideStackAllocatorTest::PushTemporary", "PushTemporary");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::PopPersistant),
         "DoubleSideStackAllocatorTest::PopPersistant", "PopPersistant");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::PopTemporary),
         "DoubleSideStackAllocatorTest::PopTemporary", "PopTemporary");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::PeekPersistant),
         "DoubleSideStackAllocatorTest::PeekPersistant", "PeekPersistant");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::PeekTemporary),
         "DoubleSideStackAllocatorTest::PeekTemporary", "PeekTemporary");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::PeekSizePersistant),
         "DoubleSideStackAllocatorTest::PeekSizePersistant", "PeekSizePersistant");
     AddTest(MakeDelegate(this, &DoubleSideStackAllocatorTest::PeekSizeTemporary),
         "DoubleSideStackAllocatorTest::PeekSizeTemporary", "PeekSizeTemporary");
 }
开发者ID:wangscript,项目名称:RadonFramework,代码行数:24,代码来源:DoubleSideStackAllocator.cpp


示例18: switch

void Process::HandleOnExecConnected(int e) {
  // is this called only from program, or does a port reconnect also call this?  if so, some logic in connect/disconnect needs to be fixed

  if ( m_bExecConnected ) {
    std::cout << "was this due to port reconnect?" << std::endl;
  }
  else {
    // (1) create underlying symbol, then (2) get strike list
    m_mapStrikeInfo.clear(); /// horribly buggy this way.
    m_vCrossOverPoints.clear();

    switch ( m_eMode ) {
      case EModeSimulation:
        break;
      case EModeLive:
        // try load from database first
        try {
          m_pUnderlying = ou::tf::InstrumentManager::Instance().Get( m_sSymbolName );
          // need to also prime TWS with symbol
          m_tws->GetSymbol( m_pUnderlying );  // preload symbol
          HandleUnderlyingListingDone();
        }
        catch (...) {
          // otherwise request the contract information
          m_contract.secType = "STK";
          m_tws->SetOnContractDetailsHandler( MakeDelegate( this, &Process::HandleUnderlyingListing ) );
          m_tws->SetOnContractDetailsDoneHandler( MakeDelegate( this, &Process::HandleUnderlyingListingDone ) );
          m_tws->RequestContractDetails( m_contract );
        }
        break;
    }

    m_bExecConnected = true;
    HandleOnConnected( e );
  }
}
开发者ID:rburkholder,项目名称:trade-frame,代码行数:36,代码来源:Process.cpp


示例19: IMPL_LUA_FUNC

IMPL_LUA_FUNC(LuaWindowExport, ListenUIDestroy)
{
    try
    {
        CLuaWindow* self;
        self = static_cast<CLuaWindow*>(LuaStatic::CheckUserData(l, 1));
        CControlUI* pControl = static_cast<CControlUI*>(LuaStatic::CheckUserData(l, 2));
        pControl->OnDestroy += MakeDelegate(self, &CLuaWindow::onUIDestroy);
        return 0;
    }
    catch (...)
    {
        DuiException(_T("LuaWindowExport::ListenUIEvent"));
        return 0;
    }
}
开发者ID:uvbs,项目名称:myduilib,代码行数:16,代码来源:LuaWindowExport.cpp


示例20: NetworkEventForwarder

void TeapotWarsLogic::CreateNetworkEventForwarder(const int socketId)
{
    NetworkEventForwarder* pNetworkEventForwarder = GCC_NEW NetworkEventForwarder(socketId);

    IEventManager* pGlobalEventManager = IEventManager::Get();

	// then add those events that need to be sent along to amy attached clients
    pGlobalEventManager->VAddListener(MakeDelegate(pNetworkEventForwarder, &NetworkEventForwarder::ForwardEvent), EvtData_PhysCollision::sk_EventType);
    pGlobalEventManager->VAddListener(MakeDelegate(pNetworkEventForwarder, &NetworkEventForwarder::ForwardEvent), EvtData_Destroy_Actor::sk_EventType);
    pGlobalEventManager->VAddListener(MakeDelegate(pNetworkEventForwarder, &NetworkEventForwarder::ForwardEvent), EvtData_Fire_Weapon::sk_EventType);
    pGlobalEventManager->VAddListener(MakeDelegate(pNetworkEventForwarder, &NetworkEventForwarder::ForwardEvent), EvtData_Environment_Loaded::sk_EventType);
    pGlobalEventManager->VAddListener(MakeDelegate(pNetworkEventForwarder, &NetworkEventForwarder::ForwardEvent), EvtData_New_Actor::sk_EventType);
    pGlobalEventManager->VAddListener(MakeDelegate(pNetworkEventForwarder, &NetworkEventForwarder::ForwardEvent), EvtData_Move_Actor::sk_EventType);
	pGlobalEventManager->VAddListener(MakeDelegate(pNetworkEventForwarder, &NetworkEventForwarder::ForwardEvent), EvtData_Request_New_Actor::sk_EventType);
    pGlobalEventManager->VAddListener(MakeDelegate(pNetworkEventForwarder, &NetworkEventForwarder::ForwardEvent), EvtData_Network_Player_Actor_Assignment::sk_EventType);

    m_networkEventForwarders.push_back(pNetworkEventForwarder);
}
开发者ID:AsbjoernS,项目名称:gamecode4,代码行数:18,代码来源:TeapotWars.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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