/** Stop serializing. */
void TupleOutputStreamProcessor::close()
{
    for (TupleOutputStreamProcessor::iterator iter = begin(); iter != end(); ++iter) {
        iter->endRows();
    }
    clearState();
}
Esempio n. 2
0
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. */
}
Esempio n. 3
0
// 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();
}
Esempio n. 4
0
CalBone::CalBone(CalCoreBone* coreBone)
  : m_pSkeleton(0)
{
  assert(coreBone);
  m_pCoreBone = coreBone;
  clearState();
}
Esempio n. 5
0
PV_Arguments::~PV_Arguments() {
   for(int a=0; a<numArgs; a++) {
      free(args[a]);
   }
   free(args);
   clearState();
}
Esempio n. 6
0
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());
}
Esempio n. 7
0
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;
		}
	}
}
Esempio n. 8
0
void CObjectBase::clearThis()
{
    turnOffCollision();
    setObjectDictionary(NULL);
    removeAllChildrenWithCleanup(true);
    clearState();
}
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();
}
Esempio n. 10
0
/* 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;
}
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));
}
Esempio n. 12
0
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);
}
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);
  */
}
//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;
}
Esempio n. 15
0
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;
}
Esempio n. 16
0
Particle::Particle(const magnet::xml::Node& XML, unsigned long nID):
  _ID(nID),
  _peculiarTime(0.0),
  _state(DEFAULT)
{
  if (XML.hasAttribute("Static")) clearState(DYNAMIC);

  _pos << XML.getNode("P");
  _vel << XML.getNode("V");
}
Esempio n. 17
0
ErrorType SendMsgState::onInit() {
	if (shouldReset()) {
		memset(&MsgBuffer[0], 0, sizeof(MsgBuffer));
		getKeyboardContext().init(&MsgBuffer[0], sizeof(MsgBuffer));
	} else {
		clearState(DONT_RESET);
	}
	InternalState = TYPE_MESSAGE;
	return ErrorType();
}
Esempio n. 18
0
void PageComponent::base_clearState(){
    
    for( int i=0; i<mComponents.size(); i++ ) {
        PageComponent *c = *( mComponents.getElement( i ) );

        c->base_clearState();
        }


    clearState();
    }
Esempio n. 19
0
uint IcdPrivate::statistics(QList<IcdStatisticsResult>& stats_results)
{
    QTimer timer;
    QVariant reply;
    QVariantList vl;
    uint signals_left, total_signals;
    IcdStatisticsResult result;

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

    if (!signals_left)
        return 0;

    timer.setSingleShot(true);
    timer.start(timeout);
    stats_results.clear();
    while (signals_left) {
	mInterface.clear();
	while (timer.isActive() && mInterface.isEmpty()) {
	    QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
	}

	if (!timer.isActive()) {
	    total_signals = 0;
	    break;
	}

	if (mSignal != ICD_DBUS_API_STATISTICS_SIG) {
	    continue;
	}

	if (mError.isEmpty()) {
  	    get_statistics_all_result(mArgs, result);
	    stats_results << result;
	    signals_left--;
	} else {
	    qWarning() << "Error:" << mError;
	    break;
	}
    }
    timer.stop();

    return total_signals;
}
Esempio n. 20
0
void Channel::destroy()
{
	if(isDestroyed())
	{
		// CRITICAL_MSG("is channel has Destroyed!\n");
		return;
	}

	clearState();
	mFlags |= Flag_Destroyed;
}
Esempio n. 21
0
void FileTransferSettingsWidget::loadImpl()
{
	m_factoriesWidget->clear();
	clearState();
	foreach (FileTransferFactory *factory, FileTransferManager::factories()) {
		QListWidgetItem *item = new QListWidgetItem(m_factoriesWidget);
		item->setText(factory->name());
		item->setIcon(factory->icon());
		item->setData(DescriptionRole, qVariantFromValue(factory->description()));
		item->setData(FactoryClassNameRole, factory->metaObject()->className());
	}
Esempio n. 22
0
void MainWindow::OnCloseEffectFinish(GuiElement *element){
    if(getterMenu == element){
        removeFromAllElements(element);
    }else{
        //! remove element from draw list and push to delete queue
        remove(element);
    }

    AsyncDeleter::pushForDelete(element);
    getterMenu = NULL;

    clearState(GuiElement::STATE_DISABLE_INPUT);
}
void StaticPage::stopQuickConfigWritting() {
    qDebug() << "Stopping quick configuration writing...";

    if(m_state >= State_Programming_Multiple) {
        ui->quickStopBtn->setEnabled(true);
        return;
    }

    m_keysProgrammedCtr = 0;
    clearState();

    freezeQuickPage(false);
    ui->quickResetBtn->setEnabled(true);
}
Esempio n. 24
0
uint IcdPrivate::addrinfo(QString& service_type, uint service_attrs,
			  QString& service_id, QString& network_type,
			  uint network_attrs, QByteArray& network_id,
			  IcdAddressInfoResult& addr_result)
{
    QTimer timer;
    QVariant reply;
    uint total_signals;
    QVariantList vl;

    clearState();

    reply = mDBus->call(ICD_DBUS_API_ADDRINFO_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_ADDRINFO_SIG) {
            mInterface.clear();
	    continue;
	}
    }

    timer.stop();

    if (mError.isEmpty()) {
        get_addrinfo_all_result(mArgs, addr_result);
    } else {
        qWarning() << "Error:" << mError;
    }

    // The returned value should be one because we asked for one addrinfo
    return total_signals;
}
void BluetoothController::readSerial(byte serialCommand){
	clearState();
	switch (serialCommand) {
	case 48:
		//Serial.println("IDLE");
		isIdle = true;
		break;
	case 49:
		//Serial.println("UP");
		isPressingUp = true;
		break;
	case 50:
		//Serial.println("DOWN");
		isPressingDown = true;
		break;
	case 51:
		//Serial.println("LEFT");
		isPressingLeft = true;
		break;
	case 52:
		//Serial.println("RIGHT");
		isPressingRight = true;
		break;
	case 53:
		//Serial.println("X");
		isPressingX = true;
		break;
	case 54:
		//Serial.println("CIRCLE");
		isPressingCircle = true;
		break;
	case 55:
		//Serial.println("SQUARE");
		isPressingSquare = true;
		break;
	case 56:
		//Serial.println("TRI");
		isPressingTriangle = true;
		break;
	case 57:
		//Serial.println("SELECT");
		isPressingSelect = true;
		break;
	case 65:
		//Serial.println("START");
		isPressingStart = true;
		break;
	}
}
Esempio n. 26
0
void ColorsListChoiceWidget::setColorLists(const QList<QColor>& colorList0, const QList<QColor>& colorList1)
{
    if (colorList0.size() != colorList1.size()) {
        qDebug() << "Incorrect argument sizes in ColorsListChoiceWidget::setColorLists";
        return;
    }
    auto currentColors = colorLists();
    if (std::get<0>(currentColors) != colorList0 || std::get<1>(currentColors) != colorList1) {
        clearState();
        for (int i = 0; i < colorList0.size(); ++i) {
            addColorWidgetWithButton(colorList0[i], colorList1[i]);
        }
        emit colorListsChanged();
    }

}
void StaticPage::setCurrentPage(int pageIndex) {
    //Page changed...

    m_currentPage = pageIndex;

    switch(pageIndex){
    case Page_Quick:
        resetQuickPage();
        break;
    case Page_Advanced:
        resetAdvPage();
        break;
    }

    setCurrentIndex(pageIndex);

    //Clear state
    m_keysProgrammedCtr = 0;
    clearState();
}
Esempio n. 28
0
void LLDrawable::makeStatic(BOOL warning_enabled)
{
	if (isState(ACTIVE))
	{
		clearState(ACTIVE);
		gPipeline.setActive(this, FALSE);

		if (mParent.notNull() && mParent->isActive() && warning_enabled)
		{
			LL_WARNS_ONCE("Drawable") << "Drawable becomes static with active parent!" << LL_ENDL;
		}

		LLViewerObject::const_child_list_t& child_list = mVObjp->getChildren();
		for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
			 iter != child_list.end(); iter++)
		{
			LLViewerObject* child = *iter;
			LLDrawable* child_drawable = child->mDrawable;
			if (child_drawable)
			{
				if (child_drawable->getParent() != this)
				{
					llwarns << "Child drawable has unknown parent." << llendl;
				}
				child_drawable->makeStatic(warning_enabled);
			}
		}
		
		if (mVObjp->getPCode() == LL_PCODE_VOLUME)
		{
			gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE);
		}		
		
		if (mSpatialBridge)
		{
			mSpatialBridge->markDead();
			setSpatialBridge(NULL);
		}
	}
	updatePartition();
}
Esempio n. 29
0
void LLDrawable::makeStatic(BOOL warning_enabled)
{
	if (isState(ACTIVE) && 
		!isState(ACTIVE_CHILD) && 
		!mVObjp->isAttachment() && 
		!mVObjp->isFlexible())
	{
		clearState(ACTIVE | ANIMATED_CHILD);

		//drawable became static with active parent, not acceptable
		llassert(mParent.isNull() || !mParent->isActive() || !warning_enabled);
		
		LLViewerObject::const_child_list_t& child_list = mVObjp->getChildren();
		for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
			 iter != child_list.end(); iter++)
		{
			LLViewerObject* child = *iter;
			LLDrawable* child_drawable = child->mDrawable;
			if (child_drawable)
			{
				if (child_drawable->getParent() != this)
				{
					LL_WARNS() << "Child drawable has unknown parent." << LL_ENDL;
				}
				child_drawable->makeStatic(warning_enabled);
			}
		}
		
		if (mVObjp->getPCode() == LL_PCODE_VOLUME)
		{
			gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE);
		}		
		
		if (mSpatialBridge)
		{
			mSpatialBridge->markDead();
			setSpatialBridge(NULL);
		}
		updatePartition();
	}
}
Status
H264DecYUVWorkSpace::allocate(const sDimensions &lumaSize,Ipp8u bpp,Ipp8u chroma_format)
{
    sDimensions paddedSize;
        // rounded up to an integral number of macroblocks

    paddedSize.width  = (lumaSize.width  + 15) & ~15;
    paddedSize.height = (lumaSize.height + 15) & ~15;

    clearState();

    Status ps = H264DecYUVBufferPadded::allocate(paddedSize,bpp,chroma_format);

    if (ps == UMC_OK)
    {
        m_macroBlockSize.width  = paddedSize.width  >> 4;
        m_macroBlockSize.height = paddedSize.height >> 4;

        //m_subBlockSize.width    = m_macroBlockSize.width  << 2;
        //m_subBlockSize.height   = m_macroBlockSize.height << 2;
    }