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


C++ clearState函数代码示例

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


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

示例1: clearState

/** Stop serializing. */
void TupleOutputStreamProcessor::close()
{
    for (TupleOutputStreamProcessor::iterator iter = begin(); iter != end(); ++iter) {
        iter->endRows();
    }
    clearState();
}
开发者ID:87439247,项目名称:voltdb,代码行数:8,代码来源:TupleOutputStreamProcessor.cpp

示例2: clearState

int PV_Arguments::resetState() {
   int status = clearState();
   pvAssert(status == PV_SUCCESS);
   return setStateFromCmdLineArgs(true);
   /* If unrecognized arguments were not allowed in the constructor and there were unrecognized args in argv,
    * the error would have taken place during the constructor. */
}
开发者ID:PetaVision,项目名称:OpenPV,代码行数:7,代码来源:PV_Arguments.cpp

示例3: mSemStateChange

// Class used to wait for state changes
MyPlayerListenerPoller::MyPlayerListenerPoller(int iTimeoutSecs)
  : mSemStateChange(OsBSem::Q_PRIORITY, OsBSem::EMPTY)
  , mSemGuard(OsBSem::Q_PRIORITY, OsBSem::FULL)
{
  miTimeoutSec = iTimeoutSecs  ;
  clearState();
}
开发者ID:mranga,项目名称:sipxecs,代码行数:8,代码来源:MyPlayerListenerPoller.cpp

示例4: m_pSkeleton

CalBone::CalBone(CalCoreBone* coreBone)
  : m_pSkeleton(0)
{
  assert(coreBone);
  m_pCoreBone = coreBone;
  clearState();
}
开发者ID:imclab,项目名称:Writer,代码行数:7,代码来源:bone.cpp

示例5: free

PV_Arguments::~PV_Arguments() {
   for(int a=0; a<numArgs; a++) {
      free(args[a]);
   }
   free(args);
   clearState();
}
开发者ID:PetaVision,项目名称:OpenPV,代码行数:7,代码来源:PV_Arguments.cpp

示例6: saveState

FormatToken Scanner::readMultiLineComment(int literalId)
{
	saveState(State_MultiLineComment, QChar(static_cast<ushort>(literalId)));
	for(;;) {
		QChar ch = m_src.peek();
		if(ch.isNull())
			break;
		if(ch == QLatin1Char(']'))
		{
			bool bMatching = true;
			for(int i=0; i < literalId; ++i)
			{
				if(m_src.peek(i+1) != QLatin1Char('='))
				{
					bMatching = false;
					break;
				}
			}
			if(bMatching && m_src.peek(literalId+1) == QLatin1Char(']'))
			{
				clearState();
				m_src.move(literalId+2);
				break;
			}
		}
		m_src.move();
	}
	return FormatToken(Format_MLComment, m_src.anchor(), m_src.length());
}
开发者ID:EssGeeEich,项目名称:LuaEditor,代码行数:29,代码来源:luascanner.cpp

示例7: clearState

void LLVOCacheEntry::setState(U32 state)
{
	if(state > LOW_BITS) //special states
	{
		mState |= (HIGH_BITS & state);
		return;
	}

	//
	//otherwise LOW_BITS states
	//
	clearState(LOW_BITS);
	mState |= (LOW_BITS & state);

	if(getState() == ACTIVE)
	{
		const S32 MIN_INTERVAL = 64 + sMinFrameRange;
		U32 last_visible = getVisible();
		
		setVisible();

		U32 cur_visible = getVisible();
		if(cur_visible - last_visible > MIN_INTERVAL ||
			cur_visible < MIN_INTERVAL)
		{
			mLastCameraUpdated = 0; //reset
		}
		else
		{
			mLastCameraUpdated = LLViewerRegion::sLastCameraUpdated;
		}
	}
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:33,代码来源:llvocache.cpp

示例8: turnOffCollision

void CObjectBase::clearThis()
{
    turnOffCollision();
    setObjectDictionary(NULL);
    removeAllChildrenWithCleanup(true);
    clearState();
}
开发者ID:raymondma,项目名称:EliminationPlane,代码行数:7,代码来源:CObjectBase.cpp

示例9: showStatusMessage

void StaticPage::on_quickWriteConfigBtn_clicked() {
    emit showStatusMessage(NULL, -1);

    if(!ui->quickProgramMulKeysBox->isChecked()) {
        m_keysProgrammedCtr = 0;
    }

    //Validate settings
    if(!validateQuickSettings()) {
        return;
    }

    clearState();

    freezeQuickPage(true);

    // Change state
    if(ui->quickProgramMulKeysBox->isChecked()) {
        if(ui->quickAutoProgramKeysCheck->isChecked()) {
            m_keysProgrammedCtr = 0;
            m_state = State_Programming_Multiple_Auto;
        } else {
            m_state = State_Programming_Multiple;
        }
    } else {
        m_keysProgrammedCtr = 0;
        m_state = State_Programming;
    }

    writeQuickConfig();
}
开发者ID:Yubico,项目名称:yubikey-personalization-gui,代码行数:31,代码来源:staticpage.cpp

示例10: PDEBUG

/* Special version of the state() call which does not call event loop.
 * Needed in order to fix NB#175098 where Qt4.7 webkit crashes because event
 * loop is run when webkit does not expect it. This function is called from
 * bearer management API syncStateWithInterface() in QNetworkSession
 * constructor.
 */
uint IcdPrivate::state(QList<IcdStateResult>& state_results)
{
    QVariant reply;
    QVariantList vl;
    uint signals_left, total_signals;
    IcdStateResult result;
    time_t started;
    int timeout_secs = timeout / 1000;

    PDEBUG("%s\n", "state_results");

    clearState();
    reply = mDBus->call(ICD_DBUS_API_STATE_REQ);
    if (reply.type() != QVariant::List)
        return 0;
    vl = reply.toList();
    if (vl.isEmpty())
        return 0;
    reply = vl.first();
    signals_left = total_signals = reply.toUInt();
    if (!signals_left)
        return 0;

    started = time(0);
    state_results.clear();
    mError.clear();
    while (signals_left) {
        mInterface.clear();
	while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) {
	    mDBus->synchronousDispatch(1000);
        QCoreApplication::sendPostedEvents(icd, QEvent::MetaCall);
	}

        if (time(0)>(started+timeout_secs)) {
	    total_signals = 0;
	    break;
	}

	if (mSignal != ICD_DBUS_API_STATE_SIG) {
	    continue;
	}

	if (mError.isEmpty()) {
	    if (!mArgs.isEmpty()) {
	        if (mArgs.size()==2)
	            get_state_all_result2(mArgs, result);
		else
	            get_state_all_result(mArgs, result);
		state_results << result;
	    }
	    signals_left--;
	} else {
	    qWarning() << "Error:" << mError;
	    break;
	}
    }

    PDEBUG("total_signals=%d\n", total_signals);
    return total_signals;
}
开发者ID:RS102839,项目名称:qt,代码行数:66,代码来源:maemo_icd.cpp

示例11: QStackedWidget

StaticPage::StaticPage(QWidget *parent) :
        QStackedWidget(parent),
        ui(new Ui::StaticPage)
{
    ui->setupUi(this);

    m_ykConfig = 0;
    m_keyPresent = false;
    clearState();

    //Connect pages
    connectPages();

    //Connect help buttons
    connectHelpButtons();

    //Connect other signals and slots
    connect(YubiKeyFinder::getInstance(), SIGNAL(keyFound(bool, bool*, int)),
            this, SLOT(keyFound(bool, bool*)));

    connect(ui->quickResetBtn, SIGNAL(clicked()),
            this, SLOT(resetQuickPage()));
    connect(ui->advResetBtn, SIGNAL(clicked()),
            this, SLOT(resetAdvPage()));

    ui->quickResultsWidget->resizeColumnsToContents();
    ui->advResultsWidget->resizeColumnsToContents();

    QRegExp rx("^[a-f0-9]{0,72}$");
    ui->quickScanCodesTxt->setValidator(new QRegExpValidator(rx, this));
}
开发者ID:jshufelt,项目名称:yubikey-personalization-gui,代码行数:31,代码来源:staticpage.cpp

示例12: clearState

void RenderingRuleSearchRequest::setInitialTagValueZoom(std::string tag, std::string value, int zoom, MapDataObject* obj) {
	clearState();
	this->obj = obj;
	setIntFilter(PROPS->R_MINZOOM, zoom);
	setIntFilter(PROPS->R_MAXZOOM, zoom);
	setStringFilter(PROPS->R_TAG, tag);
	setStringFilter(PROPS->R_VALUE, value);
}
开发者ID:shramov,项目名称:Osmand,代码行数:8,代码来源:renderRules.cpp

示例13: doTrails

void doTrails(Player *p) {
  static QuadBuffer *q = NULL;
  int size;
  int *index;
  if(q == NULL) {
    size = getTrailCount() + 12;
    printf("allocating QuadBuffer, size %d\n", size);
    q = createQuadBuffer(size);
  } else {
    size = getTrailCount() + 12;
    if(size > q->size) { 
      printf("reallocating QuadBuffer, size %d\n", size);
      freeQuadBuffer(q);
      /* we don't want to reallocate immediately, no make it a bit larger */
      q = createQuadBuffer(size + 36); 
    }
  }
  q->current = 0;
  clearState();
  if(game2->settingsCache.alpha_trails) {
    /* depth sort everything */
    int i;
    for(i = 0; i < game->players; i++) {
      bufferPlayerTrail(game->player + i, q);
      bufferPlayerBow(game->player + i, q);
    }
    index = getSortedQuads(q, p->camera->cam);
    glEnable(GL_BLEND);
    drawTrails(q, index);
    glDisable(GL_BLEND);
    if(index != NULL) free(index);
  } else {
    /* draw non-transparent trails first (unsorted), then draw
       bows */
    int i;
    /* flat shaded, no blending */
    for(i = 0; i < game->players; i++) {
      bufferPlayerTrail(game->player + i, q);
    }

    drawTrails(q, NULL);

    for(i = 0; i < game->players; i++) {
      bufferPlayerBow(game->player + i, q);
    }
    /* bows are transparent, so sort back-to-front */
    index = getSortedQuads(q, p->camera->cam);
    glEnable(GL_BLEND);
    drawTrails(q, index);
    glDisable(GL_BLEND);
    if(index != NULL) free(index);
  }
  
  /* 
     printf("%d texture bounds\n", state->binds);
     printf("%d texture mod changes\n", state->mod_changes);
  */
}
开发者ID:BackupTheBerlios,项目名称:gltron-svn,代码行数:58,代码来源:trails_buffered.c

示例14: clearState

//virtual 
bool LLViewerOctreeGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& maxOut)
{
	const OctreeNode* node = mOctreeNode;

	if (node->isEmpty())
	{	//don't do anything if there are no objects
		if (empty && mOctreeNode->getParent())
		{	//only root is allowed to be empty
			OCT_ERRS << "Empty leaf found in octree." << LL_ENDL;
		}
		return false;
	}

	LLVector4a& newMin = mObjectExtents[0];
	LLVector4a& newMax = mObjectExtents[1];
	
	if (hasState(OBJECT_DIRTY))
	{ //calculate new bounding box
		clearState(OBJECT_DIRTY);

		//initialize bounding box to first element
		OctreeNode::const_element_iter i = node->getDataBegin();
		LLViewerOctreeEntry* entry = *i;
		const LLVector4a* minMax = entry->getSpatialExtents();

		newMin = minMax[0];
		newMax = minMax[1];

		for (++i; i != node->getDataEnd(); ++i)
		{
			entry = *i;
			minMax = entry->getSpatialExtents();
			
			update_min_max(newMin, newMax, minMax[0]);
			update_min_max(newMin, newMax, minMax[1]);
		}
		
		mObjectBounds[0].setAdd(newMin, newMax);
		mObjectBounds[0].mul(0.5f);
		mObjectBounds[1].setSub(newMax, newMin);
		mObjectBounds[1].mul(0.5f);
	}
	
	if (empty)
	{
		minOut = newMin;
		maxOut = newMax;
	}
	else
	{
		minOut.setMin(minOut, newMin);
		maxOut.setMax(maxOut, newMax);
	}
		
	return TRUE;
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:57,代码来源:llvieweroctree.cpp

示例15: clearState

uint IcdPrivate::state(QString& service_type, uint service_attrs,
		       QString& service_id, QString& network_type,
		       uint network_attrs, QByteArray& network_id,
		       IcdStateResult& state_result)
{
    QTimer timer;
    QVariant reply;
    uint total_signals;
    QVariantList vl;

    clearState();

    reply = mDBus->call(ICD_DBUS_API_STATE_REQ,
			service_type, service_attrs, service_id,
			network_type, network_attrs, network_id);
    if (reply.type() != QVariant::List)
        return 0;
    vl = reply.toList();
    if (vl.isEmpty())
        return 0;
    reply = vl.first();
    total_signals = reply.toUInt();
    if (!total_signals)
        return 0;

    timer.setSingleShot(true);
    timer.start(timeout);

    mInterface.clear();
    while (timer.isActive() && mInterface.isEmpty()) {
        QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);

	if (mSignal != ICD_DBUS_API_STATE_SIG) {
            mInterface.clear();
	    continue;
	}
    }

    timer.stop();

    if (mError.isEmpty()) {
        if (!mArgs.isEmpty()) {
	    if (mArgs.size()>2)
	        get_state_all_result(mArgs, state_result);
	    else {
	        // We are not connected as we did not get the status we asked
	        return 0;
	    }
	}
    } else {
        qWarning() << "Error:" << mError;
    }

    // The returned value should be one because we asked for one state
    return total_signals;
}
开发者ID:RS102839,项目名称:qt,代码行数:56,代码来源:maemo_icd.cpp


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