本文整理汇总了C++中Leave函数的典型用法代码示例。如果您正苦于以下问题:C++ Leave函数的具体用法?C++ Leave怎么用?C++ Leave使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Leave函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:dragosht,项目名称:courses,代码行数:30,代码来源:Test5.c
示例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();
}
}
}
开发者ID:aminere,项目名称:VLADHeavyStrikePublic,代码行数:58,代码来源:FollowCameraPathVisitor.cpp
示例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;
}
开发者ID:FireWalkerX,项目名称:yiimp,代码行数:13,代码来源:list.cpp
示例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();
}
开发者ID:watfordxp,项目名称:MikeNet,代码行数:22,代码来源:MemoryUsageLog.cpp
示例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;
}
}
开发者ID:dragosht,项目名称:courses,代码行数:48,代码来源:Test6.c
示例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();
}
开发者ID:AndrianDTR,项目名称:udf,代码行数:35,代码来源:udfFinalMarks.cpp
示例7: AtCrossThreadPersistent
void RecursiveEdgeVisitor::VisitCrossThreadPersistent(
CrossThreadPersistent* e) {
AtCrossThreadPersistent(e);
Enter(e);
e->ptr()->Accept(this);
Leave();
}
开发者ID:george-hopkins,项目名称:pkg-webrtc,代码行数:7,代码来源:Edge.cpp
示例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();
}
开发者ID:OCLC-Developer-Network,项目名称:MARCView-Convert,代码行数:9,代码来源:vcriticallinkedlistmanager.hpp
示例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();
}
开发者ID:OCLC-Developer-Network,项目名称:MARCView-Convert,代码行数:9,代码来源:vcriticallinkedlistmanager.hpp
示例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);
}
开发者ID:ggcrunchy,项目名称:bounce-testing,代码行数:30,代码来源:Widget_Imp.cpp
示例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;
}
开发者ID:eduardovra,项目名称:vlc,代码行数:30,代码来源:wasapi.c
示例12: ImmSetOpenStatus
// Set IME open state
void CImeView::SetState(BOOL fOpen)
{
if (Enter()) {
ImmSetOpenStatus(m_hIMC, fOpen);
Leave();
}
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:8,代码来源:ImeView.cpp
示例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)));
}
开发者ID:sersajur,项目名称:QPentago,代码行数:25,代码来源:Game.cpp
示例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_);
}
开发者ID:Mezomish,项目名称:leechcraft,代码行数:31,代码来源:roomhandler.cpp
示例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();
}
}
开发者ID:Darrenbydesign,项目名称:HoloToolkit,代码行数:31,代码来源:SessionImpl.cpp
示例16: Leave
int
User::LeaveIfError(int error)
{
if (OpStatus::IsError(error))
Leave(error);
return error;
}
开发者ID:prestocore,项目名称:browser,代码行数:7,代码来源:excepts.cpp
示例17: Leave
// IMN_SETOPENSTATUS:
BOOL CImeView::SetOpenStatus()
{
if (!Enter())
return FALSE;
if (ImmGetOpenStatus(m_hIMC)) {
// the IME conversion engine is open
} else {
// Here we close and destroy all of candidate windows
// if IME conversion engine is closed.
for (int i = 0; i < MAX_LISTCAND; i++ ) {
if (m_CandList[i]) {
::DestroyWindow(m_hwndCand[i]);
m_hwndCand[i] = NULL;
delete m_CandList[i];
m_CandList[i] = NULL;
}
}
m_nCompLen = 0;
m_nState = 0;
}
Leave();
return TRUE;
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:26,代码来源:ImeView.cpp
示例18: LOWORD
int CImeView::GetCompCursorPos()
{
if (!Enter())
return 0;
int ret = LOWORD(ImmGetCompositionString(m_hIMC, GCS_CURSORPOS, NULL, 0));
Leave();
return ret;
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:8,代码来源:ImeView.cpp
示例19: _FindMatchingMode
status_t
GlutGameMode::Enter()
{
display_mode* mode = _FindMatchingMode();
if (!mode)
return B_BAD_VALUE;
BScreen screen;
if (!fActive) {
// First enter: remember this workspace original mode...
fGameModeWorkspace = current_workspace();
screen.GetMode(fGameModeWorkspace, &fOriginalMode);
}
// Don't make it new default mode for this workspace...
status_t status = screen.SetMode(fGameModeWorkspace, mode, false);
if (status != B_OK)
return status;
// Retrieve the new active display mode, which could be
// a sligth different than the one we asked for...
screen.GetMode(fGameModeWorkspace, &fCurrentMode);
if (!fGameModeWindow) {
// create a new window
fPreviousWindow = glutGetWindow();
fGameModeWindow = glutCreateWindow("glutGameMode");
if (!fGameModeWindow)
return Leave();
} else
// make sure it's the current window
glutSetWindow(fGameModeWindow);
BDirectWindow *directWindow
= dynamic_cast<BDirectWindow*>(gState.currentWindow->Window());
if (directWindow == NULL)
// Hum?!
return B_ERROR;
// Give it some useless title, except for debugging (thread name).
BString name;
name << "Game Mode " << fCurrentMode.virtual_width
<< "x" << fCurrentMode.virtual_height
<< ":" << _GetModePixelDepth(&fCurrentMode)
<< "@" << _GetModeRefreshRate(&fCurrentMode);
// force the game mode window to fullscreen
directWindow->Lock();
directWindow->SetTitle(name.String());
directWindow->SetFullScreen(true);
directWindow->Unlock();
fDisplayChanged = true;
fActive = true;
return B_OK;
}
开发者ID:looncraz,项目名称:haiku,代码行数:57,代码来源:glutGameMode.cpp
示例20: UpdateColor
//! updates the visitor
void ColorVisitor::Update()
{
if(!m_bActive)
{
return;
}
if(m_fInterpolator < 1.0f)
{
Color color = Math::Lerp(m_SrcColor, m_DestColor, m_fInterpolator);
UpdateColor(color);
m_fInterpolator += (g_fDeltaTime/m_fDuration);
}
else
{
UpdateColor(m_DestColor);
m_iPlayCount++;
switch(m_ePlaybackType)
{
case PT_Once:
Leave();
break;
case PT_Loop:
case PT_Toggle:
if((m_iMaxPlayCount < 0) || (m_iPlayCount < m_iMaxPlayCount))
{
(m_ePlaybackType == PT_Toggle) ? Math::Swap(m_SrcColor, m_DestColor) : void();
m_fInterpolator = 0.0f;
}
else
{
Leave();
}
break;
default:
Leave();
}
}
}
开发者ID:aminere,项目名称:VLADHeavyStrikePublic,代码行数:45,代码来源:ColorVisitor.cpp
注:本文中的Leave函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论