本文整理汇总了C++中Leave函数的典型用法代码示例。如果您正苦于以下问题:C++ Leave函数的具体用法?C++ Leave怎么用?C++ Leave使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Leave函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IesireDinWaiting5
void IesireDinWaiting5()
{
if(GetNrX()==0)
{
sleep(1);
test("Verifica4",Verifica(1,0,1,0,0,1)==0);
IncNrX();
Signal(m,1);
sleep(1);
test("Verifica5",Verifica(1,0,2,1,0,0)==0);
Leave(m);
return;
}
if(GetNrX()==1)
{
sleep(1);
test("Verifica6",Verifica(1,0,1,1,0,0)==0);
IncNrX();
Leave(m);
return;
}
if(GetNrX()==2)
{
sleep(1);
test("Verifica7",Verifica(1,0,0,2,0,0)==0);
IncNrX();
Leave(m);
return;
}
}
示例2: if
//! updates the visitor
void FollowCameraPathVisitor::Update()
{
if(!m_bActive)
{
return;
}
f32 fRatio = m_fTimer/m_fDuration;
m_pCamera->SetPosition(m_Path->GetPosition(m_CurrentElement, m_CurrentElement+1, fRatio));
m_pCamera->SetLookAt(m_Path->GetLookAt(m_CurrentElement, m_CurrentElement+1, fRatio));
if(m_fTimer < m_fDuration)
{
m_fTimer += g_fDeltaTime;
}
else if(m_CurrentElement < s32(m_Path->GetChildCount())-2)
{
++m_CurrentElement;
f32 newDuration = m_Path->GetElement(m_CurrentElement)->GetFollowDuration();
f32 fOverTime = (m_fTimer-m_fDuration)*(m_fDuration/newDuration);
m_fDuration = newDuration-fOverTime;
m_fTimer = fOverTime + g_fDeltaTime;
}
else
{
m_iPlayCount++;
switch(m_ePlaybackType)
{
case PT_Once:
Leave();
break;
case PT_Loop:
if((m_iMaxPlayCount < 0) || (m_iPlayCount < m_iMaxPlayCount))
{
m_CurrentElement = 0;
f32 newDuration = m_Path->GetElement(m_CurrentElement)->GetFollowDuration();
f32 fOverTime = (m_fTimer-m_fDuration)*(m_fDuration/newDuration);
m_fDuration = newDuration-fOverTime;
m_fTimer = fOverTime + g_fDeltaTime;
}
else
{
Leave();
}
break;
case PT_Toggle:
SHOOT_WARNING(false, "FollowCameraPathVisitor Unsupported PlaybackType: PT_Toggle");
Leave();
break;
default:
Leave();
}
}
}
示例3: Enter
CLI CommonList::Find(void *data)
{
Enter();
for(CLI item = first; item; item = item->next)
if(data == item->data)
{
Leave();
return item;
}
Leave();
return NULL;
}
示例4: Enter
/**
* @brief Decreases the amount of memory memory usage logged.
*
* @throws ErrorReport If integer overflow will occur.
*
* @param amount The amount to decrease memory usage logged by.
*/
void MemoryUsageLog::DecreaseMemorySize( size_t amount )
{
Enter();
try
{
size_t newMemoryUsage = this->GetMemorySize() - amount;
_ErrorException((amount > 0 && newMemoryUsage >= this->GetMemorySize()),"decreasing the logged memory usage of an object, integer overflow will occur",0,__LINE__,__FILE__);
this->memoryUsage = newMemoryUsage;
}
catch(ErrorReport & report) {Leave(); throw report;}
catch(...) {Leave(); throw(-1);}
Leave();
}
示例5: IesireDinWait6
void IesireDinWait6()
{
if(GetNrX()==0)
{
sleep(1);
test("Verifica3",Verifica(1,0,2,0,1,0)==0);
IncNrX();
Wait(m,0);
IesireDinWait6();
return;
}
if(GetNrX()==1)
{
sleep(1);
test("Verifica4",Verifica(1,0,1,1,2,0)==0);
IncNrX();
Broadcast(m,0);
sleep(1);
test("Verifica5",Verifica(1,0,3,2,0,0)==0);
Leave(m);
return;
}
if(GetNrX()==2)
{
sleep(1);
test("Verifica6",Verifica(1,0,2,2,0,0)==0);
IncNrX();
Leave(m);
return;
}
if(GetNrX()==3)
{
sleep(1);
test("Verifica7",Verifica(1,0,1,3,0,0)==0);
IncNrX();
Leave(m);
return;
}
if(GetNrX()==4)
{
sleep(1);
test("Verifica8",Verifica(1,0,0,4,0,0)==0);
IncNrX();
Leave(m);
return;
}
}
示例6: Enter
void udfFinalMarks::UpdateMarks()
{
Enter();
int nRow = 0;
for(nRow = 0; nRow < m_gridMarks->GetNumberRows(); ++nRow)
{
int nCol = 0;
for(nCol = 0; nCol < m_gridMarks->GetNumberCols(); ++nCol)
{
unsigned int id = -1;
CChampionshipJudgesMarkTable::tDATA data = {0};
data.tourId = m_tourId;
data.teamId = m_row2id[nRow];
data.judgeId = m_col2id[nCol];
long found = CChampionshipJudgesMarkTable(m_pCon).FindId(id, data);
__info("Row: %d, Col: %d, tourId: %d, teamId: %d, FOUND: %d == %d", nRow, nCol, data.tourId, data.teamId, found, UDF_E_NOTFOUND);
if(UDF_OK == found)
{
__info("Found! ID: %d. Update it...", id);
m_gridMarks->GetCellValue(nRow, nCol).ToULong((unsigned long *)&data.nMark);
CChampionshipJudgesMarkTable(m_pCon).UpdateRow(id, data);
}
else if(found == UDF_E_NOTFOUND)
{
__info("NOT Found! Insert it...");
m_gridMarks->GetCellValue(nRow, nCol).ToULong((unsigned long *)&data.nMark);
CChampionshipJudgesMarkTable(m_pCon).AddRow(data);
}
}
}
Leave();
}
示例7: AtCrossThreadPersistent
void RecursiveEdgeVisitor::VisitCrossThreadPersistent(
CrossThreadPersistent* e) {
AtCrossThreadPersistent(e);
Enter(e);
e->ptr()->Accept(this);
Leave();
}
示例8: Delete
/** Delete pItem from the linked list. If bDeleteItem is VTRUE, delete
will be called on pItem.*/
virtual VBOOL Delete( VLinkedListItem* pItem,
VBOOL bDeleteItem = VTRUE)
{
Enter();
VLinkedListManager::Delete(pItem, bDeleteItem);
Leave();
}
示例9: Add
/** Adds an item to the end of the linked list unless
bAddAtBeginningOfList is VTRUE.*/
virtual void Add( VLinkedListItem* pItem,
VBOOL bAddAtBeginningOfList = VFALSE)
{
Enter();
VLinkedListManager::Add(pItem, bAddAtBeginningOfList);
Leave();
}
示例10: IssueEvent
/// @brief Performs upkeep logic
/// @param bPressed If true, there is a press
void Widget::Upkeep (bool bPressed)
{
IssueEvent(ePreUpkeep);
// Perform leave logic.
Leave();
// If the widget is signaled, perform enter logic; on a press, perform grab logic.
if (IsSignaled())
{
Enter();
if (bPressed) Grab();
}
// If there is no press, perform drop logic.
if (!bPressed) Drop();
// If the widget remains chosen, post-process it; otherwise, abandon it.
if (!IsSignaled() && !IsChosen())
{
mState->ClearChoice();
IssueEvent(eAbandon);
}
else IssueEvent(ePostUpkeep);
}
示例11: SimpleVolumeSet
static int SimpleVolumeSet(audio_output_t *aout, float vol, bool mute)
{
aout_sys_t *sys = aout->sys;
HRESULT hr;
if (vol > 1.)
vol = 1.;
Enter();
/* NOTE: better change volume while muted (if mute is toggled) */
if (mute)
{
hr = ISimpleAudioVolume_SetMute(sys->volume.simple, true, NULL);
if (FAILED(hr))
msg_Warn(aout, "cannot mute session (error 0x%lx)", hr);
}
hr = ISimpleAudioVolume_SetMasterVolume(sys->volume.simple, vol, NULL);
if (FAILED(hr))
msg_Warn(aout, "cannot set session volume (error 0x%lx)", hr);
if (mute)
{
hr = ISimpleAudioVolume_SetMute(sys->volume.simple, false, NULL);
if (FAILED(hr))
msg_Warn(aout, "cannot unmute session (error 0x%lx)", hr);
}
Leave();
return 0;
}
示例12: ImmSetOpenStatus
// Set IME open state
void CImeView::SetState(BOOL fOpen)
{
if (Enter()) {
ImmSetOpenStatus(m_hIMC, fOpen);
Leave();
}
}
示例13: userInterface
Game::Game(shared_ptr<IView> _view)
: userInterface(std::move(_view))
{
Q_ASSERT(userInterface);
players.push_back(std::make_unique<Player>("Player 1"));
players.push_back(std::make_unique<Player>("Player 2"));
auto v = userInterface.get();
// connect View to Presenter
connect(v, SIGNAL(New_game(int)), this, SLOT(new_game(int)));
connect(v, SIGNAL(Save_game(std::string)), this, SLOT(save_game(std::string)));
connect(v, SIGNAL(Load_game(std::string)), this, SLOT(load_game(std::string)));
connect(v, SIGNAL(Host_game(std::string)), this, SLOT(host_game(std::string)));
connect(v, SIGNAL(Join_game(std::string)), this, SLOT(join_game(std::string)));
connect(v, SIGNAL(Leave()), this, SLOT(leave()));
connect(v, SIGNAL(Put_stone(int,int)), this, SLOT(put_stone(int,int)));
connect(v, SIGNAL(Rotate(IView::quadrant,IView::turn)), this, SLOT(rotate(IView::quadrant,IView::turn)));
// connect Presenter to View
connect(this, SIGNAL(draw_stone(int,int,IView::color)),v,SLOT(Draw_stone(int,int,IView::color)));
connect(this, SIGNAL(set_control_settings(IView::control_setting)),v,SLOT(Set_control_settings(IView::control_setting)));
connect(this, SIGNAL(message(string)), v, SLOT(Show_message(string)));
}
示例14: tr
void RoomHandler::HandleNickConflict ()
{
// The room is already joined, should do nothing special here.
if (!Nick2Entry_.isEmpty ())
return;
if (QMessageBox::question (0,
tr ("Nickname conflict"),
tr ("You have specified a nickname for the conference "
"%1 that's already used. Would you like to try to "
"join with another nick?")
.arg (RoomJID_),
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
{
Leave (QString ());
return;
}
const QString& newNick = QInputDialog::getText (0,
tr ("Enter new nick"),
tr ("Enter new nick for joining the conference %1 (%2 is already used):")
.arg (RoomJID_)
.arg (OurNick_),
QLineEdit::Normal,
OurNick_);
if (newNick.isEmpty ())
return;
OurNick_ = newNick;
Account_->GetClientConnection ()->GetMUCManager ()->joinRoom (RoomJID_, OurNick_);
}
示例15: XTASSERT
void SessionImpl::OnJoinSessionReply(const JoinSessionReply& reply, const NetworkConnectionPtr&)
{
XTASSERT(m_curState == MachineSessionState::JOINING);
if (reply.GetResult())
{
LogInfo("Session Join Succeeded");
SetState(MachineSessionState::JOINED);
// Add the connection to the session to the Sync manager
m_context->GetSyncManager()->AddConnection(m_sessionConnection);
m_context->GetInternalSyncManager()->AddConnection(m_sessionConnection);
// Connect the tunnel between the secondary client and the session
m_tunnelBridge = new TunnelBridge(m_sessionConnection, m_context->GetPairedConnection());
AddUser(m_context->GetLocalUser());
m_sessionMgr->NotifyOnUserJoinedSessionListeners(this, m_context->GetLocalUser());
// Tell all listeners that we've successfully created the session.
m_listenerList->NotifyListeners(&SessionListener::OnJoinSucceeded);
}
else
{
LogInfo("Session Join Failed!");
Leave();
}
}