当前位置: 首页>>代码示例>>C++>>正文


C++ getStack函数代码示例

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


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


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