本文整理汇总了C++中IsDone函数的典型用法代码示例。如果您正苦于以下问题:C++ IsDone函数的具体用法?C++ IsDone怎么用?C++ IsDone使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsDone函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Tick
int Scene::Tick(int* currFunction, int* currTask) {
if(IsDone())
return (int)SUCCES;
if(stack.empty())
return (int)FAILURE;
// Go to stack and execute last entry if not null-pointer. If null-pointer, remove and take next. If stack is empty, return false.
while(functions[stack.back().x][stack.back().y] == UNDEFINED) { // Find entry which is not undefined
stack.pop_back();
if(stack.empty())
return FAILURE; // No more commmands. We already checked if we solved the task, so we return FAILURE
}
*currFunction = stack.back().x;
*currTask = stack.back().y;
// Execute function
int returnValue = CallFunc(functions[stack.back().x][stack.back().y]);
// (x, y+1) into stack.
stack.back().y++;
// If return is not -1, put (return, 0) into stack;
if(returnValue != -1)
stack.push_back((Pos){returnValue, 0});
return (int)NOT_DONE;
}
示例2: GetProgress
CVariant CKadOperation::AddLoadRes(const CVariant& LoadRes, CKadNode* pNode)
{
SOpProgress* pProgress = GetProgress(pNode);
CVariant FilteredRes = LoadRes.Clone(false); // Make a Shellow Copy
const CVariant& LoadedList = LoadRes["RES"];
CVariant FilteredList;
for(uint32 i=0; i < LoadedList.Count(); i++)
{
CVariant Loaded = LoadedList.At(i).Clone(false); // Make a Shellow Copy
const CVariant& XID = Loaded["XID"];
// Counting
if(pProgress) // might be NULL if we filter our own index response right now
{
SOpStatus &Status = pProgress->Loads[XID];
Status.Results++;
if(!Loaded.Get("MORE"))
Status.Done = true; // this marks that no more results are to be expected form this node
}
SOpStatus* pStatus = &m_LoadMap[XID].Status;
pStatus->Results++;
if(!pStatus->Done)
pStatus->Done = IsDone(SOpProgress::GetLoads, XID);
if(!pStatus->Done)
Loaded.Insert("MORE", true);
else
Loaded.Remove("MORE");
//
if(Loaded.Has("ERR"))
{
FilteredList.Append(Loaded);
continue;
}
// Filtering
CVariant UniquePayloads;
const CVariant& Payloads = Loaded["PLD"];
for(uint32 j=0; j < Payloads.Count(); j++)
{
const CVariant& Payload = Payloads.At(j);
if(m_LoadFilter[XID].insert(Payload["DATA"].GetFP()).second)
UniquePayloads.Append(Payload);
}
// Note: we must add this even if UniquePayloads is empty or else we will misscount replys
CVariant NewLoaded;
NewLoaded["XID"] = XID;
NewLoaded["PLD"] = UniquePayloads;
FilteredList.Append(NewLoaded);
//
}
FilteredRes.Insert("RES", FilteredList);
return FilteredRes;
}
示例3: IsDone
void CLoadLTADlg::OnTimer(UINT nIDEvent)
{
CEdit* pEdit = ((CEdit*)GetDlgItem(IDC_LOADLOG));
pEdit->SetSel(-1, 0, TRUE);
if(nIDEvent == TIMER_ID)
{
BOOL bDone = IsDone();
//see if we need to update the load log
//(the check is done so that when it is running, we don't refresh it
//continually)
if(m_bPrevLoaderDone == FALSE)
{
UpdateLoadLog();
}
//see if the finishing state has finished at all
if(bDone != m_bPrevLoaderDone)
{
((CButton*)GetDlgItem(IDC_SAVELOADLOG))->EnableWindow(bDone);
((CButton*)GetDlgItem(IDOK))->EnableWindow(bDone);
m_bPrevLoaderDone = bDone;
}
// automatically close the dialog on load completion
if( m_bAutoConfirm && bDone && m_bPrevLoaderDone )
{
OnOK();
}
}
CDialog::OnTimer(nIDEvent);
}
示例4: NS_ERROR
//------------------------------------------------------------
void
nsFilteredContentIterator::Last()
{
if (!mCurrentIterator) {
NS_ERROR("Missing iterator!");
return;
}
// If we are switching directions then
// we need to switch how we process the nodes
if (mDirection != eBackward) {
mCurrentIterator = mIterator;
mDirection = eBackward;
mIsOutOfRange = false;
}
mCurrentIterator->Last();
if (mCurrentIterator->IsDone()) {
return;
}
nsINode *currentNode = mCurrentIterator->GetCurrentNode();
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(currentNode));
bool didCross;
CheckAdvNode(node, didCross, eBackward);
}
示例5: NS_ASSERTION
void
nsFilteredContentIterator::Prev()
{
if (mIsOutOfRange || !mCurrentIterator) {
NS_ASSERTION(mCurrentIterator, "Missing iterator!");
return;
}
// If we are switching directions then
// we need to switch how we process the nodes
if (mDirection != eBackward) {
nsresult rv = SwitchDirections(false);
if (NS_FAILED(rv)) {
return;
}
}
mCurrentIterator->Prev();
if (mCurrentIterator->IsDone()) {
return;
}
// If we can't get the current node then
// don't check to see if we can skip it
nsINode *currentNode = mCurrentIterator->GetCurrentNode();
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(currentNode));
CheckAdvNode(node, mDidSkip, eBackward);
}
示例6:
PyObject *pyllbc_PackLemma_Top::Read(pyllbc_Stream *stream)
{
if (UNLIKELY(!IsDone()))
{
pyllbc_SetError("top-lemma not done, could not unpack data");
return NULL;
}
size_t idx = 0;
PyObject *values = PyTuple_New(_lemmas.size());
for (; idx < _lemmas.size(); idx++)
{
PyObject *value;
Base *lemma = _lemmas[idx];
if (!(value = lemma->Read(stream)))
break;
PyTuple_SET_ITEM(values, idx, value);
}
if (idx != _lemmas.size())
{
Py_DECREF(values);
values = NULL;
}
return values;
}
示例7: Rewind
HRESULT
SoundD3D::Play()
{
if (IsPlaying()) return S_OK;
if (!buffer) return E_FAIL;
HRESULT hr = E_FAIL;
if (IsDone())
hr = Rewind();
if (IsReady()) {
if (moved)
Localize();
if (flags & LOOP || flags & STREAMED)
hr = buffer->Play(0, 0, DSBPLAY_LOOPING);
else
hr = buffer->Play(0, 0, 0);
if (SUCCEEDED(hr))
status = PLAYING;
}
return hr;
}
示例8: IsFinished
bool CLIENTFX_INSTANCE::IsFinished()
{
if (IsDone())
return true;
CLinkListNode<FX_LINK> *pActiveNode = m_collActiveFX.GetHead();
CBaseFX *pFX = LTNULL;
while (pActiveNode)
{
pFX = pActiveNode->m_Data.m_pFX;
// Check for expiration
if( pFX )
{
//determine if this effect has expired
bool bExpired = ((pFX->GetElapsed() >= pFX->GetEndTime()) || pFX->IsShuttingDown()) &&
(pFX->IsFinishedShuttingDown() || !pActiveNode->m_Data.m_pRef->m_bSmoothShutdown);
if (!bExpired)
return false;
}
pActiveNode = pActiveNode->m_pNext;
}
return true;
}
示例9: DrawAt
void BattleAnimation::DrawAt(int x, int y) {
if (!sprite) return; // Initialization failed
if (IsDone()) return;
const RPG::AnimationFrame& anim_frame = animation.frames[frame];
std::vector<RPG::AnimationCellData>::const_iterator it;
for (it = anim_frame.cells.begin(); it != anim_frame.cells.end(); ++it) {
const RPG::AnimationCellData& cell = *it;
if (!cell.valid) {
// Skip unused cells (they are created by deleting cells in the
// animation editor, resulting in gaps)
continue;
}
sprite->SetX(cell.x + x);
sprite->SetY(cell.y + y);
int sx = cell.cell_id % 5;
int sy = cell.cell_id / 5;
int size = large ? 128 : 96;
sprite->SetSrcRect(Rect(sx * size, sy * size, size, size));
sprite->SetOx(size / 2);
sprite->SetOy(size / 2);
sprite->SetTone(Tone(cell.tone_red * 128 / 100,
cell.tone_green * 128 / 100,
cell.tone_blue * 128 / 100,
cell.tone_gray * 128 / 100));
sprite->SetOpacity(255 * (100 - cell.transparency) / 100);
sprite->SetZoomX(cell.zoom / 100.0);
sprite->SetZoomY(cell.zoom / 100.0);
sprite->Draw();
}
}
示例10:
const LLBC_String &pyllbc_PackLemma::ToString() const
{
if (!IsDone())
return _emptyStr;
return _str;
}
示例11: UpdateDisplays
void Environment::Run(const int n_steps)
{
int t;
unsigned int i;
for(i = 0; i < agents.size(); i++)
{
agents[i]->SetPerformance(0);
}
UpdateDisplays();
if(delay)
{
sleep(delay);
}
for(t = 0; t < n_steps; t++)
{
if(IsDone())
{
return;
}
Step();
if(delay)
{
sleep(delay);
}
}
}
示例12: NAssert
void T_SimpleListIterator<Item>::Next() {
NAssert(!IsDone()) ;
if (_reverse) {
_current=_current->prev ;
} else {
_current=_current->next ;
}
}
示例13: IteratorOutOfBoundException
const char& String::StringIterator::CurrentItem() const
{
if (IsDone()) {
throw IteratorOutOfBoundException();
}
return (_string->operator[](_current));
}
示例14: OnCancel
void CLoadLTADlg::OnCancel()
{
//don't let them quit while the thread is running
if(IsDone() == FALSE)
return;
CDialog::OnCancel();
}
示例15:
Item MyListIterator<Item>::CurrentItem() const
{
if(IsDone())
{
throw IteratorOutOfBounds;
}
return _list->Get(_current);
}