void wmsPopNotifyFlags() { if(theNotifyFlagsStack.empty()) { return; } theNotifyFlags = theNotifyFlagsStack.top(); theNotifyFlagsStack.pop(); }
int PopExpListValueCount() { if (exp_list_value_count_.empty()) return 0; int result = exp_list_value_count_.top(); exp_list_value_count_.pop(); return result; }
void reset() { while(!VIEWSTACK.empty()) { VIEWSTACK.pop(); } WORLDVIEW = new ViewBox(W,H,0,0); VIEWSTACK.push(*WORLDVIEW); }
container convertStackToContainer(std::stack<uint32_t>& stack) { container result; do { result.push_back(stack.top()); stack.pop(); } while(not stack.empty()); std::reverse(result.begin(), result.end()); return result; }
Pla& step () { REQUIRE (!scopes_.empty() && scopes_.top()); Pla& pos = *scopes_.top(); ++scopes_.top(); scopes_.push(index_.getReferrers(pos.getID())); return pos; }
bool CameraManager::update(float dt) { static std::stack<int> precedingBehaviors; if ( dt == 0 ) return false; mTransScale = mTransSpeed * dt; mRotScale = mRotateSpeed * dt; ctx.mCurrTruck = BeamFactory::getSingleton().getCurrentTruck(); ctx.mDt = dt; ctx.mRotScale = Degree(mRotScale); ctx.mTransScale = mTransScale; ctx.fovInternal = Degree(FSETTING("FOV Internal", 75.0f)); ctx.fovExternal = Degree(FSETTING("FOV External", 60.0f)); if ( currentBehaviorID < CAMERA_BEHAVIOR_END && INPUTENGINE.getEventBoolValueBounce(EV_CAMERA_CHANGE) ) { switchToNextBehavior(false); } if ( INPUTENGINE.getEventBoolValueBounce(EV_CAMERA_FREE_MODE_FIX) ) { toggleBehavior(CAMERA_BEHAVIOR_FIXED); } if ( INPUTENGINE.getEventBoolValueBounce(EV_CAMERA_FREE_MODE) ) { toggleBehavior(CAMERA_BEHAVIOR_FREE); } if ( !ctx.mCurrTruck && hasActiveVehicleBehavior() ) { precedingBehaviors.push(currentBehaviorID); switchBehavior(CAMERA_BEHAVIOR_CHARACTER); } else if ( ctx.mCurrTruck && hasActiveCharacterBehavior() ) { if ( !precedingBehaviors.empty() ) { switchBehavior(precedingBehaviors.top(), false); precedingBehaviors.pop(); } else { switchBehavior(CAMERA_BEHAVIOR_VEHICLE); } } if ( currentBehavior ) { currentBehavior->update(ctx); } else { switchBehavior(CAMERA_BEHAVIOR_CHARACTER); } return true; }
void glScissorPop() { if(!scissorStack.empty()) { Recti scissor = scissorStack.top(); scissorStack.pop(); glScissor(scissor.min[0], scissor.min[1], scissor.max[0] - scissor.min[0] + 1, scissor.max[1] - scissor.min[1] + 1); } }
void pop() { if (s.empty()) { return; } if (min.top() == s.top()) { min.pop(); } s.pop(); }
void PrintStack(std::stack<int> stackIn) { while(!stackIn.empty()) { std::cout << stackIn.top() << " "; stackIn.pop(); } std::cout << "\n"; }
jmp_buf* catch_point() { if ( catch_points.empty() ) { fprintf(stderr, "Fatal internal error: Exception stack underflow\n"); exit(1); } return catch_points.top(); }
void printstack(std::stack<frac*> s ) { std::cout<<"stack:"<<std::endl; while(!s.empty()) { s.top()->display(); s.pop(); } }
// Note: empties the passed stack std::vector<int> toIndexPath(std::stack<maze_point> path, int mazeSize) { std::vector<int> indexPath; indexPath.reserve(path.size()); while (!path.empty()) { indexPath.push_back(path.top().position.getIndex(mazeSize)); path.pop(); } return indexPath; }
void reverse_stack(std::stack<T>& st) { if(!st.empty()) { T top = st.top(); st.pop(); reverse_stack(st); add_to_stack_bottom(st, top); } }
void ReverseStack(std::stack<int>& stack) { if (!stack.empty() ) { int top = stack.top(); stack.pop(); ReverseStack(stack); addtobottom(stack,top); } }
void pop() { if (elements.empty()) { return; } if (elements.top() == mins.top()) { mins.pop(); } elements.pop(); }
template<typename T> void Add_Bottom(std::stack<T>& stk, T val) { if(stk.empty()) stk.push(val); else { T t = stk.top(); stk.pop(); Add_Bottom(stk, val); stk.push(t); } }
/// reduce stack by given amount n void reduce_stack(std::size_t n) { if (n <= 0) return; std::string reduced_value = ""; for (std::size_t i = 0; i < n && !stack_.empty(); ++i) { reduced_value = stack_.top() + reduced_value; stack_.pop(); } stack_.push(reduced_value); state_.parameters.push_back(reduced_value); }
//This method is used to catch if there are either more opening or closing braces //PRE: stack, line number //POST: none void AST::catchUnequalBracesException(std::stack<std::string>& bracesStack, unsigned i){ try{ if(bracesStack.empty()){ throw i + 1; } }catch(unsigned int e){ std::cout<<"ERROR IN SOURCE CODE, TOO MANY CLOSING BRACES FROM LINE NO:"<<e<<std::endl; std::terminate(); } }
int getMaximumPriority(std::stack<letter*> _tray) { int mp = -1; while (!_tray.empty()) { int tp = _tray.top()->getPriority(); if (tp > mp) mp = tp; _tray.pop(); } return mp; }
std::shared_ptr<T> pop() { std::lock_guard<std::mutex> lock(m_); if (data_.empty()) { throw empty_stack(); } std::shared_ptr<T> const res(std::make_shared<T>(data_.top())); data_.pop(); return res; }
std::pair<int, int> nexttotop(std::stack<std::pair<int, int> > s){ std::pair<int, int> topofStack = s.top(); s.pop(); if (!s.empty()) { std::pair<int, int> toret = s.top(); s.push(topofStack); return toret; } }
void undo() { using namespace std; if(!undo_stack.empty()) { redo_stack.push(s); s = undo_stack.top(); undo_stack.pop(); } }
void redo() { using namespace std; if(!redo_stack.empty()) { undo_stack.push(s); s = redo_stack.top(); redo_stack.pop(); } }
void Pop() { if(!pilhaadd.empty()){ while(!pilhaadd.empty()) { pilhatmp.push(pilhaadd.top()); pilhaadd.pop(); } pilhatmp.pop(); while(!pilhatmp.empty()) { pilhaadd.push(pilhatmp.top()); pilhatmp.pop(); } } }
//--------------------------------------------------------------------- // ゲーム板を初期化する //--------------------------------------------------------------------- LRESULT OnGameInit(HWND hwnd, WPARAM wParam, LPARAM lParam) { while (!g_gameStack.empty()) g_gameStack.pop(); g_game.InitCells(); InvalidateRect(hwnd, NULL, TRUE); return 0; }
/** @return the next smallest number */ int next() { if(cur != NULL && cur->right != NULL){ getLeftPath(cur->right); } if(!s.empty()){ cur = s.top(); s.pop(); } return cur->val; }
void pop(T& value) throw(threadsafe_stack_empty) { std::lock_guard<TT> lock(m); if (data.empty()) { throw threadsafe_stack_empty("Stack is empty!"); } value = std::move_if_noexcept(data.top()); data.pop(); }
void reverse(std::stack<int> s) { if(s.empty()) return; int top = s.top(); s.pop(); push_to_bottom(s, top); reverse(s); }
void popStackSetMap(std::stack<Ptr>& s, HashMap& map, const Ptr& cur) { auto s_top = s.top(); s.pop(); if (s.empty()) { map[s_top] = { nullptr, cur }; } else { map[s_top] = { s.top(), cur }; } }
ObjectHandle::ObjectHandle() { if (freedHandles.empty()) { i32.ID = nextFreeLocalID++; i32.owner = 0; } else { i64 = freedHandles.top(); freedHandles.pop(); } }