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

C++ getStack函数代码示例

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

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



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

示例1: getStack

void ScriptApiBase::setOriginFromTableRaw(int index, const char *fxn)
{
#ifdef SCRIPTAPI_DEBUG
	lua_State *L = getStack();

	m_last_run_mod = lua_istable(L, index) ?
		getstringfield_default(L, index, "mod_origin", "") : "";
	//printf(">>>> running %s for mod: %s\n", fxn, m_last_run_mod.c_str());
#endif
}
开发者ID:JohnWayne1986,项目名称:minetest,代码行数:10,代码来源:s_base.cpp


示例2: getStack

void MohawkEngine_Riven::addZipVisitedCard(uint16 cardId, uint16 cardNameId) {
	Common::String cardName = getStack()->getName(kCardNames, cardNameId);
	if (cardName.empty())
		return;
	ZipMode zip;
	zip.name = cardName;
	zip.id = cardId;
	if (Common::find(_zipModeData.begin(), _zipModeData.end(), zip) == _zipModeData.end())
		_zipModeData.push_back(zip);
}
开发者ID:nuridol,项目名称:scummvm-kor,代码行数:10,代码来源:riven.cpp


示例3: errCatchEnd

void errCatchEnd(struct errCatch *errCatch)
/* Restore error handlers and pop self off of catching stack. */
{
popWarnHandler();
popAbortHandler();
struct errCatch **pErrCatchStack = getStack(), *errCatchStack = *pErrCatchStack;
if (errCatch != errCatchStack)
   errAbort("Mismatch betweene errCatch and errCatchStack");
*pErrCatchStack = errCatch->next;
}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:10,代码来源:errCatch.c


示例4: getStack

// Creates a new anonymous reference if cobj=NULL or id=0
void ScriptApiBase::objectrefGetOrCreate(
		ServerActiveObject *cobj)
{
	lua_State *L = getStack();

	if(cobj == NULL || cobj->getId() == 0){
		ObjectRef::create(L, cobj);
	} else {
		objectrefGet(cobj->getId());
	}
}
开发者ID:EcoleKeine,项目名称:minetest,代码行数:12,代码来源:s_base.cpp


示例5: getStack

int32_t ZendExecutionStack::numArgs() {
  auto& stack = getStack();
  auto& entry = stack.m_stack.back();
  switch (entry.mode) {
    case ZendStackMode::HHVM_STACK:
      return ((HPHP::ActRec*)entry.value)->numArgs();
    case ZendStackMode::SIDE_STACK:
      // Zend puts the number of args as the last thing on the stack
      return uintptr_t(entry.value);
  }
  not_reached();
  return 0;
}
开发者ID:MaimaiCoder,项目名称:hhvm,代码行数:13,代码来源:ZendExecutionStack.cpp


示例6: getStack

void PluginHost::processStack(float *buffer, int stackType, Channel *ch) {

	gVector <Plugin *> *pStack = getStack(stackType, ch);

	/* empty stack, stack not found or mixer not ready: do nothing */
	/// TODO - join evaluation

	if (!G_Mixer.ready)
		return;
	if (pStack == NULL)
		return;
	if (pStack->size == 0)
		return;

	/* converting buffer from Giada to VST */

	for (unsigned i=0; i<kernelAudio::realBufsize; i++) {
		bufferI[0][i] = buffer[i*2];
		bufferI[1][i] = buffer[(i*2)+1];
	}

	/* hardcore processing. At the end we swap input and output, so that
	 * the N-th plugin will process the result of the plugin N-1. */

	for (unsigned i=0; i<pStack->size; i++) {
		/// TODO - join evaluation

		if (pStack->at(i)->status != 1)
			continue;
		if (pStack->at(i)->suspended)
			continue;
		if (pStack->at(i)->bypass)
			continue;
		if (ch) {   // process events if it's a channel stack
			if (ch->type == CHANNEL_MIDI) {
				///gLog("events: %d\n", (((MidiChannel*)ch)->getVstEvents())->numEvents);
				pStack->at(i)->processEvents(((MidiChannel*)ch)->getVstEvents());
			}
		}
		pStack->at(i)->processAudio(bufferI, bufferO, kernelAudio::realBufsize);
		bufferI = bufferO;
	}

	/* converting buffer from VST to Giada. A note for the future: if we
	 * overwrite (=) (as we do now) it's SEND, if we add (+) it's INSERT. */

	for (unsigned i=0; i<kernelAudio::realBufsize; i++) {
		buffer[i*2]     = bufferO[0][i];
		buffer[(i*2)+1] = bufferO[1][i];
	}
}
开发者ID:holt0102,项目名称:giada,代码行数:51,代码来源:pluginHost.cpp


示例7: assert

void pkCU::updateState_move()
{
	assert(getStackStage() == STAGE_SEEDED);
	advanceStackStage();

	// the floor of the stack: everything below this stack value has been evaluated
	size_t baseFloor = iBase, baseCeil = getStack().size(), iNBase;

	// evaluate first pokemon's moves, and their probabilities (iBase provided by updateState)
	evaluateMove();

	// POSSIBLE THAT POKEMON MIGHT HAVE DIED IN PREVIOUS STEP

	iBase = baseFloor;
	swapTeamIndexes();

	// TODO: STAGE_POSTROUND should automatically be set after the second go-around as stage keeps incrementing
	// increment with iNBase, as evaluateMove will manipulate stack
	for (iNBase = baseFloor, baseCeil = getStack().size(); iNBase != baseCeil; ++iNBase, iBase = iNBase)
	{
		// do not evaluate a move that has not been evaluated by first pokemon yet:
		if (getStackStage() != STAGE_POSTTURN) { continue; }

		// if the pokemon died, no reason for it to take its turn
		//if (!getPKV().isAlive()) { continue; }

		// evaluate second pokemon's moves and their probabilities
		stackStage[iBase] = STAGE_PRETURN;
		evaluateMove();
	}

	// assert ALL moves have completed both turns:
	for (iBase = baseFloor, baseCeil = getStack().size(); iBase != baseCeil; ++iBase)
	{
		if (getStackStage() != STAGE_POSTTURN) { continue; }
		advanceStackStage();
	}
}
开发者ID:ubermouser,项目名称:pokemonAI,代码行数:38,代码来源:pkCU.cpp


示例8: recu

int recu(int num){
	
	printf("Stack: %d, ESP: %d, Iteration: %d\n", getStack((int)(getp()->stack)), getp()->esp, num);
	int a[200];
	a[2] = 1;
	if(num == 0){
		return 1;
	}
	else if( num%5 ){
		softyield();
	}
	recu(num-1);
	return 1;
}
开发者ID:maximovs,项目名称:so-2011-3,代码行数:14,代码来源:user_programs.c


示例9: Wikipedia

double Info::getMRatio(int index) const
{
  /*
  From Wikipedia (Herrington Zones):

  M-ratio        Zone name    "Optimal" strategy
  M >= 20        Green zone   Most desirable situation, freedom to play conservatively or aggressively as you choose
  10 <= M < 20   Yellow zone  Must take on more risk, hands containing small pairs and small suited connectors lose value
  6 <= M < 10    Orange zone  Main focus is to be first-in whatever you decide to play, important to preserve chips
  1 <= M < 6     Red zone     Your only move is to move all-in or fold
  M < 1          Dead zone    You are completely dependent on luck to survive, the only strategy is to push all-in into an empty pot
  */
  return ((double)getStack(index)) / (rules.smallBlind + rules.bigBlind + rules.ante * players.size());
}
开发者ID:chinmaygupta28,项目名称:poker-assignment,代码行数:14,代码来源:info.cpp


示例10: modnamestorer

bool ScriptApiBase::loadMod(const std::string &scriptpath,
		const std::string &modname)
{
	ModNameStorer modnamestorer(getStack(), modname);

	if (!string_allowed(modname, MODNAME_ALLOWED_CHARS)) {
		errorstream<<"Error loading mod \""<<modname
				<<"\": modname does not follow naming conventions: "
				<<"Only chararacters [a-z0-9_] are allowed."<<std::endl;
		return false;
	}

	return loadScript(scriptpath);
}
开发者ID:1CoreyDev1,项目名称:minetest,代码行数:14,代码来源:s_base.cpp


示例11: switch

void GenericMapCreature::grow()
{
	uint value, percent;
	
	switch( _growth ) {
	case Stable:
		break;
	case FixedPercentage:
		for( uint i = 0; i < MAX_UNIT; i++ ) {
			value = getStack( i );
			value = (int)( ( value * (100 + _growthParam0) ) / 100 );
			setStack( i, value );
		}
		break;
	case VariablePercentage:
		for( uint i = 0; i < MAX_UNIT; i++ ) {
			percent = _growthParam0 + ( rand() % (_growthParam1 + 1 - _growthParam0) );
			value = getStack( i );
			value = (int)( ( value * (100 + percent) ) / 100 );
			setStack( i, value );
		}
		break;
	}
}
开发者ID:q4a,项目名称:attal,代码行数:24,代码来源:genericMapCreature.cpp


示例12: getStack

CardStack* GameState::findById(int cardId, int* idx)
{
    for (int i=0; i<STACK_COUNT; i++)
    {
        CardStack* cs = getStack(i);
        for (int j=0; j<cs->size(); j++) {
            if ((*cs)[j].id == cardId) 
            {
                *idx = j;
                return cs;
            }
        }
    }

    return NULL_PTR;
}
开发者ID:sbelajevs,项目名称:xenny,代码行数:16,代码来源:model.cpp


示例13: timestamp

//=============================================================================
// METHOD: SPELLserverCif::completeMessage
//=============================================================================
void SPELLserverCif::completeMessage( SPELLipcMessage* msg )
{
    msg->set(MessageField::FIELD_TIME, timestamp() );
    msg->set(MessageField::FIELD_MSG_SEQUENCE, ISTR(m_sequence));
    m_sequence++;

    msg->set(MessageField::FIELD_CSP, getStack() + "/" + ISTR(getNumExecutions()) );

    if (isManual())
    {
        msg->set(MessageField::FIELD_EXECUTION_MODE, MessageValue::DATA_EXEC_MODE_MANUAL);
    }
    else
    {
        msg->set(MessageField::FIELD_EXECUTION_MODE, MessageValue::DATA_EXEC_MODE_PROCEDURE);
    }
}
开发者ID:unnch,项目名称:spell-sat,代码行数:20,代码来源:SPELLserverCif.C


示例14: getStack

void ScriptApiServer::getAuthHandler()
{
	lua_State *L = getStack();

	lua_getglobal(L, "core");
	lua_getfield(L, -1, "registered_auth_handler");
	if (lua_isnil(L, -1)){
		lua_pop(L, 1);
		lua_getfield(L, -1, "builtin_auth_handler");
	}

	setOriginFromTable(-1);

	lua_remove(L, -2); // Remove core
	if (lua_type(L, -1) != LUA_TTABLE)
		throw LuaError("Authentication handler table not valid");
}
开发者ID:MultiCraftProject,项目名称:MultiCraft,代码行数:17,代码来源:s_server.cpp


示例15: DEBUG

//=============================================================================
// METHOD    : SPELLcallstack::event_call
//=============================================================================
void SPELLcallstack::event_call( const std::string& file, const int& line, const std::string& name )
{
	// Call to a function, increase the stack
	DEBUG("[CSTACK] Event call: " + file + ":" + ISTR(line) + ", mode=" + ISTR(m_soMode) + ", so=" + BSTR(isSteppingOver()));

	// Consider first the first call in the execution: create the roots
	if (m_rootNode == NULL)
	{
		DEBUG("[CSTACK] First call" );
		m_rootNode = new SPELLcodeTreeNode(0,file,line,NULL);
		m_currentNode = m_rootNode;
		m_viewNode = m_rootNode;

	    // Visit the line
		SPELLexecutor::instance().getFrame().getTraceModel(file).setCurrentLine(line);
	}
	else // If we are in this case, there is a subprocedure being called
	{
		assert(m_currentNode != NULL);

		DEBUG("[CSTACK] Function call" );
		// ...and ensure the next line will be marked by default
		m_markExecuted = true;
		// Will add the child code corresponding to the call

		DEBUG("[CSTACK] Doing call on node " + m_currentNode->getCodeIdentifier() + ", depth " + ISTR(m_currentNode->getDepth()) );
		m_currentNode->eventCall(file,line);
		// Now update which the current node is
		m_currentNode = m_currentNode->getCurrentLine()->getChildCode();
		// If we are stepping over, do not change the view node position
		// otherwise move the view node together with the leaf
		if ( m_soMode >= SO_ONCE_INTO )
		{
			DEBUG("[CSTACK] Increasing level: " + ISTR(m_soMode) );
			m_viewNode = m_currentNode;
		}
	}
    // Update the stack string
    m_stack = std::string(file + ":" + ISTR(line));
    // Update the code name string
    m_codeName = name;

	DEBUG("[CSTACK] Event call notify: " + getStack() + ", mode=" + ISTR(m_soMode) + ", so=" + BSTR(isSteppingOver()));
	SPELLexecutor::instance().getCIF().notifyCall();
}
开发者ID:seciltabur,项目名称:spell-sat,代码行数:48,代码来源:SPELLcallstack.C


示例16: ScriptApiBase

AsyncWorkerThread::AsyncWorkerThread(AsyncEngine* jobDispatcher,
		unsigned int threadNum) :
	ScriptApiBase(),
	jobDispatcher(jobDispatcher),
	threadnum(threadNum)
{
	lua_State *L = getStack();

	// Prepare job lua environment
	lua_getglobal(L, "core");
	int top = lua_gettop(L);

	// Push builtin initialization type
	lua_pushstring(L, "async");
	lua_setglobal(L, "INIT");

	jobDispatcher->prepareEnvironment(L, top);
}
开发者ID:JohnWayne1986,项目名称:minetest,代码行数:18,代码来源:s_async.cpp


示例17: Thread

AsyncWorkerThread::AsyncWorkerThread(AsyncEngine* jobDispatcher,
		const std::string &name) :
	Thread(name),
	ScriptApiBase(ScriptingType::Async),
	jobDispatcher(jobDispatcher)
{
	lua_State *L = getStack();

	// Prepare job lua environment
	lua_getglobal(L, "core");
	int top = lua_gettop(L);

	// Push builtin initialization type
	lua_pushstring(L, "async");
	lua_setglobal(L, "INIT");

	jobDispatcher->prepareEnvironment(L, top);
}
开发者ID:Caellian,项目名称:minetest,代码行数:18,代码来源:s_async.cpp


示例18: getStack

//=============================================================================
// METHOD: SPELLserverCif::notifyCall
//=============================================================================
void SPELLserverCif::notifyCall()
{
    std::string stack = getStack();

    DEBUG("[CIF] Procedure call: " + stack );

    m_lnMessage.set( MessageField::FIELD_DATA_TYPE, MessageValue::DATA_TYPE_CALL );
    m_lnMessage.setType(MSG_TYPE_NOTIFY);

    completeMessage( &m_lnMessage );
    m_lnMessage.set(MessageField::FIELD_MSG_SEQUENCE, ISTR(m_sequenceStack));
    m_sequenceStack++;
    m_lnMessage.set(MessageField::FIELD_CODE_NAME, getCodeName() );

    m_asRun->writeCall( stack, (m_sequence-1) );

    SPELLipcMessage* response = sendGUIRequest(&m_lnMessage, SPELL_CIF_NOTIFICATION_TIMEOUT_SEC);
    if (response) delete response;
}
开发者ID:unnch,项目名称:spell-sat,代码行数:22,代码来源:SPELLserverCif.C


示例19: getStack

/** Push a shader onto the top of the stack */
void ShaderManager::push(Shader* shdr){
	//std::cout << "Pushing " << shdr->filepath()<< " ID:" << shdr->shaderID() << std::endl;
	bool newProc = false;
	std::stack<Shader*>* curStack = getStack(shdr->type());
	if (!curStack->empty()){
		if (curStack->top()->priority() > shdr->priority()){
			curStack->push(curStack->top());
		} else {
			newProc = true;
		}
	} else {
		newProc = true;
	}
	if (newProc){
		curStack->push(shdr);
		invalid = true;
	}
	//curStack = NULL;
}
开发者ID:CraigRThomas,项目名称:Stormcloud,代码行数:20,代码来源:shaderMgr.cpp


示例20: getStack

bool ScriptApiBase::loadScript(const std::string &scriptpath)
{
	verbosestream<<"Loading and running script from "<<scriptpath<<std::endl;

	lua_State *L = getStack();

	int ret = luaL_loadfile(L, scriptpath.c_str()) || lua_pcall(L, 0, 0, m_errorhandler);
	if (ret) {
		errorstream << "========== ERROR FROM LUA ===========" << std::endl;
		errorstream << "Failed to load and run script from " << std::endl;
		errorstream << scriptpath << ":" << std::endl;
		errorstream << std::endl;
		errorstream << lua_tostring(L, -1) << std::endl;
		errorstream << std::endl;
		errorstream << "======= END OF ERROR FROM LUA ========" << std::endl;
		lua_pop(L, 1); // Pop error message from stack
		return false;
	}
	return true;
}
开发者ID:1CoreyDev1,项目名称:minetest,代码行数:20,代码来源:s_base.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ getStartPoint函数代码示例发布时间:2022-05-28
下一篇:
C++ getSprite函数代码示例发布时间:2022-05-28
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap