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


C++ checkState函数代码示例

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


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

示例1: executeInstructionOnStack

void Engine::push(char c) {
    if (!checkState())
        return;
    if (state == sStart) {
        executeInstructionOnStack("Copy"); // No tr
        if (!checkState()) {
            setError("Failed to copy some data"); // No tr
            return;
        }
        dStack.top()->clear();
        if (!dStack.top()->push(c, false)) {
            delete dStack.pop();
            return;
        }
        dStack.top()->clear();
        changeState(sAppend);
    } else {
        if (!Qtopia::mousePreferred() && !iStack.isEmpty() && *iStack.top() == "EvaluateLine") // No tr
            hardReset();
        changeResetState(drSoft);
        if (!dStack.top()->push(c, false)) {
            return;
        }
    }

    dStack.top()->push(c);
    emit(stackChanged());
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:28,代码来源:engine.cpp

示例2: main

int main(int argc, char **argv)
{
   initialize();
   initialize_TIMER0();
   clear_array();
   PORTC = 0;
   USART_send_string("Currently outputing color: \n");
   while(1){
      for(unsigned int i = 0; i < 8; ++i){
	 PORTE = i;
	 switch (state){
	    case RED:
	       //PORTE = 1;
	       update_row(224,0,0);
		checkState();
	       break;
	    case GREEN:
	       update_row(0,7,0);
	       checkState();
	       break;
	    case YELLOW:
	       led_off();
	       update_row(yellowRow,0,0);
	       update_row(yellowRow,0,0);
	       update_row(yellowRow,yellowRow,0);
	       update_row(yellowRow,0,0);
	       update_row(yellowRow,0,0);
	       led_off();
	       checkState();
	       break;
	 }
      }
   }
}	
开发者ID:Nrpickle,项目名称:EECS162,代码行数:34,代码来源:main.c

示例3: ASSERT

void Resource::fileLoaded(FS::IFile& file, bool success)
{
	m_is_waiting_for_load = false;
	if (m_desired_state != State::READY) return;
	
	ASSERT(m_current_state != State::READY);
	ASSERT(m_empty_dep_count == 1);

	if (!success)
	{
		g_log_error.log("Core") << "Could not open " << getPath().c_str();
		--m_empty_dep_count;
		++m_failed_dep_count;
		checkState();
		m_is_waiting_for_load = false;
		return;
	}

	if (!load(file))
	{
		++m_failed_dep_count;
	}

	--m_empty_dep_count;
	checkState();
	m_is_waiting_for_load = false;
}
开发者ID:dreamsxin,项目名称:LuxEngine,代码行数:27,代码来源:resource.cpp

示例4: connect

bool KbdKeeper::setup()
{
    connect(&m_layout, SIGNAL(keyboardChanged()), SLOT(keyboardChanged()));
    connect(&m_layout, SIGNAL(layoutChanged(uint)), SLOT(layoutChanged(uint)));
    connect(&m_layout, SIGNAL(checkState()), SLOT(checkState()));

    return true;
}
开发者ID:pritambaral,项目名称:lxqt-panel,代码行数:8,代码来源:kbdkeeper.cpp

示例5: setChecked

void CLabel::mousePressEvent(QMouseEvent *ev){
    if( checkState() == Qt::Checked ){
        setChecked(Qt::Unchecked);
    } else {
        setChecked(Qt::Checked);
    }
    emit clicked();
    emit clicked(checkState() == Qt::Checked);
    QLabel::mousePressEvent(ev);
}
开发者ID:CoActionOS,项目名称:CoActionOS-Desktop,代码行数:10,代码来源:CLabel.cpp

示例6: treeWidget

void
tag_lvitem::set_on(bool b)
{
  treeWidget()->blockSignals(true);
  if ((checkState(0)==Qt::Unchecked && b==true) ||
      (checkState(0)==Qt::Checked && b==false)) {
    DBG_PRINTF(5, "set_on changes state");
    setCheckState(0, b ? Qt::Checked : Qt::Unchecked);
    last_known_state = (b ? Qt::Checked : Qt::Unchecked);
    colorize();
  }
  treeWidget()->blockSignals(false);
}
开发者ID:AleksKots,项目名称:Manitou,代码行数:13,代码来源:tagsbox.cpp

示例7: writer

//------------------------------------------------------------------------
bool XmlRepresentationHelper::startEndCell ()
{
	if (!checkState (kInCell))
		return false;

	StringWriter writer (stream);
	String string;
	string.printf ("<%s/>", CELL_TAG);
	writer.write (string);
	writer.write (ENDLINE_A);

	if (!checkState (kInPage))
		return false;
	return true;
}
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:16,代码来源:vstrepresentation.cpp

示例8: checkState

/*!
\brief Destructs the VtkPropRenderer.
*/
mitk::VtkPropRenderer::~VtkPropRenderer()
{
  // Workaround for GLDisplayList Bug
  {
    m_MapperID=0;
    checkState();
  }

  if (m_LightKit != NULL)
    m_LightKit->Delete();

  if (m_VtkRenderer!=NULL)
  {
    m_CameraController = NULL;

    m_VtkRenderer->Delete();

    m_VtkRenderer = NULL;
  }
  else
    m_CameraController = NULL;

  if (m_WorldPointPicker != NULL)
    m_WorldPointPicker->Delete();
  if (m_PointPicker != NULL)
    m_PointPicker->Delete();
  if (m_CellPicker != NULL)
    m_CellPicker->Delete();
  if (m_TextRenderer != NULL)
    m_TextRenderer->Delete();
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:34,代码来源:mitkVtkPropRenderer.cpp

示例9: memorySave

// Memory
void Engine::memorySave() {
    if (!checkState())
        return;

    //save previous data on stack
    executeInstructionOnStack("Copy"); // No tr
    if (mem) {
        dStack.push(mem);
        executeInstructionOnStack("Add"); // No tr
    }
    if (state != sError)
        mem = dStack.pop();

    executeInstructionOnStack("Factory"); // No tr
    if (mem->getFormattedOutput() != dStack.top()->getFormattedOutput()) {
        if (memMark) memMark->show();
    } else {
        delete mem;
        mem = 0;
        if (memMark) memMark->hide();
    }
    delete dStack.pop();

    qApp->processEvents();
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:26,代码来源:engine.cpp

示例10: msa

PairAlign::PairAlign(MSAEditor* _msa)
    : msa(_msa), pairwiseAlignmentWidgetsSettings(_msa->getPairwiseAlignmentWidgetsSettings()),
    distanceCalcTask(NULL), settingsWidget(NULL),
    showHideSequenceWidget(NULL), showHideSettingsWidget(NULL), showHideOutputWidget(NULL),
    saveController(NULL), savableTab(this, GObjectViewUtils::findViewByName(_msa->getName())),
    showSequenceWidget(_msa->getPairwiseAlignmentWidgetsSettings()->showSequenceWidget),
    showAlgorithmWidget(_msa->getPairwiseAlignmentWidgetsSettings()->showAlgorithmWidget),
    showOutputWidget(_msa->getPairwiseAlignmentWidgetsSettings()->showOutputWidget),
    firstSequenceSelectionOn(false), secondSequenceSelectionOn(false),
    sequencesChanged(true), sequenceNamesIsOk(false), alphabetIsOk(false)
{
    SAFE_POINT(NULL != msa, "MSA Editor is NULL.", );
    SAFE_POINT(NULL != pairwiseAlignmentWidgetsSettings, "pairwiseAlignmentWidgetsSettings is NULL.", );

    setupUi(this);

    firstSeqSelectorWC = new SequenceSelectorWidgetController(msa);
    firstSeqSelectorWC->setObjectName("firstSeqSelectorWC");
    secondSeqSelectorWC = new SequenceSelectorWidgetController(msa);
    secondSeqSelectorWC->setObjectName("secondSeqSelectorWC");

    firstSequenceLayout->addWidget(firstSeqSelectorWC);
    secondSequenceLayout->addWidget(secondSeqSelectorWC);

    initLayout();
    initSaveController();
    connectSignals();
    initParameters();

    U2WidgetStateStorage::restoreWidgetState(savableTab);

    checkState();
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:33,代码来源:PairAlign.cpp

示例11: checkState

void
FutureBucket::makeLive(Application& app)
{
    checkState();
    assert(!isLive());
    assert(hasHashes());
    auto& bm = app.getBucketManager();
    if (hasOutputHash())
    {
        setLiveOutput(bm.getBucketByHash(hexToBin256(getOutputHash())));
    }
    else
    {
        assert(mState == FB_HASH_INPUTS);
        mInputCurrBucket =
            bm.getBucketByHash(hexToBin256(mInputCurrBucketHash));
        mInputSnapBucket =
            bm.getBucketByHash(hexToBin256(mInputSnapBucketHash));
        assert(mInputShadowBuckets.empty());
        for (auto const& h : mInputShadowBucketHashes)
        {
            auto b = bm.getBucketByHash(hexToBin256(h));
            assert(b);
            CLOG(DEBUG, "Bucket") << "Reconstituting shadow " << h;
            mInputShadowBuckets.push_back(b);
        }
        mState = FB_LIVE_INPUTS;
        startMerge(app);
        assert(isLive());
    }
}
开发者ID:AnthonyAkentiev,项目名称:stellar-core,代码行数:31,代码来源:FutureBucket.cpp

示例12: postSend

	void socket::postSend()
	{
		if (!checkState())
			return;

		if (_sendQueue.size() == 0)
			return;

		_sendBuf.clear();

		while ((_sendQueue.size() > 0) && (_sendBuf.size() + _sendQueue.front()->size() < IO_BUFFER_SIZE))
		{
			auto& buf = _sendQueue.front();
			msg_size_t size = 0;
			size += buf->size() &0xFFFF;
			_sendBuf.append((uint8_t*)&size, sizeof(msg_size_t));
			_sendBuf.append(buf->data(), buf->size());

			_sendQueue.pop_front();
		}

		if (0 == _sendBuf.size())
		{
			NET_LOG.console("Temp to send to [%s]  0 bytes message.", get_remoteaddress().c_str());
			return;
		}

		_isSending = true;

		asio::async_write(
			_socket,
			asio::buffer(_sendBuf.data(), _sendBuf.size()),
			std::bind(&socket::handleSend, shared_from_this(), std::placeholders::_1, std::placeholders::_2));
	}
开发者ID:ZhHong,项目名称:moon_net,代码行数:34,代码来源:socket.cpp

示例13: checkState

	void ResourceSkin::checkState(const MapStateInfo& _states)
	{
		for (MapStateInfo::const_iterator iter = _states.begin(); iter != _states.end(); ++iter)
		{
			checkState(iter->first);
		}
	}
开发者ID:dayongxie,项目名称:MyGUI,代码行数:7,代码来源:MyGUI_ResourceSkin.cpp

示例14: printf

void GLFrameBuffer::pushColorAttachment( GLenum iformat )
{
  if( num_color_attachments == GL_MAX_COLOR_ATTACHMENTS-1 )
  {
    printf( "ERROR: Trying to attach a new color attachment to fbo but hit max color attachments!\n" );
    return;
  }

  bind();

  glGenTextures( 1, &texture_id[num_color_attachments] );
  glActiveTexture( GL_TEXTURE0 );
  glBindTexture( GL_TEXTURE_2D, texture_id[num_color_attachments] );
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

  glTexImage2D( GL_TEXTURE_2D, 0, iformat, res[0], res[1], 0,
                //GL_RGB, GL_UNSIGNED_BYTE, 0 );
                GL_RGB, GL_FLOAT, 0 );

  glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+num_color_attachments,
                          GL_TEXTURE_2D, texture_id[num_color_attachments], 0 );
  num_color_attachments++;

  checkState();  
}
开发者ID:methmtican,项目名称:SSRAO,代码行数:28,代码来源:GLFrameBuffer.cpp

示例15: createLeaf

        Node<Status, T> createLeaf(
                const typename NodeTypes<Status, T>::ValueList& originalValueList,
                int depthRemaining,
                const State& collectedState)
        {
            typedef typename NodeTypes<Status, T>::ValuePtr ValuePtr;
            typedef typename NodeTypes<Status, T>::ValueList ValueList;

            ValueList valueList;
            if (checker_) {
                boost::remove_copy_if(
                        originalValueList,
                        std::back_inserter(valueList),
                        [this, &collectedState](const ValuePtr& value)
                        {
                            State state(collectedState);
                            for (Point  p: value->first.state()) {
                                state.addStone(p);
                            }
                            return !checkState(*checker_, value->first.table(), state);
                        });
            } else {
                valueList = originalValueList;
            }
            advanceProgress(valueList.size(), depthRemaining);
            return LeafNode<Status, T>(std::move(valueList));
        }
开发者ID:petersohn,项目名称:sokoban,代码行数:27,代码来源:NodeBuilder.hpp


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