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


C++ CheckState函数代码示例

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


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

示例1: CheckState

bool UTransBuffer::Redo()
{
	CheckState();

	if (!CanRedo())
	{
		RedoDelegate.Broadcast(FUndoSessionContext(), false);

		return false;
	}

	// Apply the redo changes.
	GIsTransacting = true;
	{
		FTransaction& Transaction = UndoBuffer[ UndoBuffer.Num() - UndoCount-- ];
		UE_LOG(LogEditorTransaction, Log,  TEXT("Redo %s"), *Transaction.GetTitle().ToString() );
		CurrentTransaction = &Transaction;

		BeforeRedoUndoDelegate.Broadcast(Transaction.GetContext());
		Transaction.Apply();
		RedoDelegate.Broadcast(Transaction.GetContext(), true);

		CurrentTransaction = nullptr;
	}
	GIsTransacting = false;

	CheckState();

	return true;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:30,代码来源:EditorTransaction.cpp

示例2: CheckState

void UTransBuffer::Reset( const FText& Reason )
{
	CheckState();

	if( ActiveCount != 0 )
	{
		FString ErrorMessage = TEXT("");
		ErrorMessage += FString::Printf(TEXT("Non zero active count in UTransBuffer::Reset") LINE_TERMINATOR );
		ErrorMessage += FString::Printf(TEXT("ActiveCount : %d"	) LINE_TERMINATOR, ActiveCount );
		ErrorMessage += FString::Printf(TEXT("SessionName : %s"	) LINE_TERMINATOR, *GetUndoContext(false).Context );
		ErrorMessage += FString::Printf(TEXT("Reason      : %s"	) LINE_TERMINATOR, *Reason.ToString() );

		ErrorMessage += FString::Printf( LINE_TERMINATOR );
		ErrorMessage += FString::Printf(TEXT("Purging the undo buffer...") LINE_TERMINATOR );

		UE_LOG(LogEditorTransaction, Log, TEXT("%s"), *ErrorMessage);

	
		// Clear out the transaction buffer...
		Cancel(0);
	}

	// Reset all transactions.
	UndoBuffer.Empty();
	UndoCount    = 0;
	ResetReason  = Reason;
	ActiveCount  = 0;

	CheckState();
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:30,代码来源:EditorTransaction.cpp

示例3: CheckState

void UMatineeTransBuffer::EndSpecial()
{
	CheckState();
	check(ActiveCount>=1);
	if( --ActiveCount==0 )
	{
		GUndo = NULL;
	}
	CheckState();
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:10,代码来源:MatineeTransBuffer.cpp

示例4: check

// UObject interface.
void UTransBuffer::Serialize( FArchive& Ar )
{
	check( !Ar.IsPersistent() );

	CheckState();

	Super::Serialize( Ar );

	if ( IsObjectSerializationEnabled() || !Ar.IsObjectReferenceCollector() )
	{
		Ar << UndoBuffer;
	}
	Ar << ResetReason << UndoCount << ActiveCount << ActiveRecordCounts;

	CheckState();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:17,代码来源:EditorTransaction.cpp

示例5: MOZ_ASSERT

nsresult
FileHandleBase::OpenInputStream(bool aWholeFile, uint64_t aStart,
                                uint64_t aLength, nsIInputStream** aResult)
{
  MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!");
  MOZ_ASSERT(mRequestMode == PARALLEL,
             "Don't call me in other than parallel mode!");

  // Common state checking
  ErrorResult error;
  if (!CheckState(error)) {
    return error.StealNSResult();
  }

  // Do nothing if the window is closed
  if (!CheckWindow()) {
    return NS_OK;
  }

  nsRefPtr<OpenStreamHelper> helper =
    new OpenStreamHelper(this, aWholeFile, aStart, aLength);

  nsresult rv = helper->Enqueue();
  NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR);

  nsCOMPtr<nsIInputStream>& result = helper->Result();
  NS_ENSURE_TRUE(result, NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR);

  result.forget(aResult);
  return NS_OK;
}
开发者ID:AtulKumar2,项目名称:gecko-dev,代码行数:31,代码来源:FileHandle.cpp

示例6: while

void cSocketTCP::run()
{
	while(!World::IsStopped())
	{
		if(!isConnected)
			Connect();

		// if connect fail, wait 5 sec
		if(!isConnected)
		{
			ACE_Based::Thread::Sleep(5000);
			continue;
		}

		Packet pck;
		if(CheckState(m_sock->Receive(pck)))
			HandlePacket(&pck);

		if(m_session)
			m_session->Update();

		ACE_Based::Thread::Sleep(100);
	}
	Close();
}
开发者ID:AwkwardDev,项目名称:MangosFX,代码行数:25,代码来源:cSocketTCP.cpp

示例7: GetState

//--------------------------------------------------------------------------------
bool CSocketServerMainThread::MainLoop()
	{
	DWORD nState = GetState();
	if(nState == STATE_PAUSE)
		{
		if(m_pSub->IsClosePortsOnPause())
			m_socket.Close();
		return true;
		}

	if(m_socket.IsValid())
		{
		if(m_socket.Listen(5))
			{
			CSmallSocket sock;
			if(m_socket.Accept(sock))
				{
				SOCKET hSocket = sock.Detach();
				if(! m_pSub->PostNextThreadMessage(CSocketServerSubSystem::MsgConnect, (WPARAM) hSocket, 0))
					sock.Attach(hSocket);
				}
			}
		}

	return CheckState();
	}
开发者ID:richschonthal,项目名称:HL7,代码行数:27,代码来源:SocketServerMainThread.cpp

示例8: detectStaLtaINT32

int detectStaLtaINT32(DETECTOR_STALTA *stalta, INT32 *data, UINT32 nsamp)
{
BOOL SeenDetection = FALSE; /* TRUE if at least one sample results in a detection ON */
UINT32 i;

    if (stalta->debug.enabled && stalta->debug.nsamp < nsamp) {
        stalta->debug.diff = (INT32 *) realloc(stalta->debug.diff, nsamp * sizeof(INT32));
        stalta->debug.sta = (INT32 *) realloc(stalta->debug.sta, nsamp * sizeof(INT32));
        stalta->debug.lta = (INT32 *) realloc(stalta->debug.lta, nsamp * sizeof(INT32));
        stalta->debug.tla = (INT32 *) realloc(stalta->debug.tla, nsamp * sizeof(INT32));
        stalta->debug.ratio = (REAL32 *) realloc(stalta->debug.ratio, nsamp * sizeof(REAL32));
        stalta->debug.state = (INT32 *) realloc(stalta->debug.state, nsamp * sizeof(INT32));
        stalta->debug.nsamp = nsamp;
    }

/* Update and test for detection sample by sample */

    for (i = 0; i < nsamp; i++) {
        UpdateRatio(stalta, data[i]);
        CheckState(stalta);
        if (!SeenDetection && stalta->work.crnt.state == DETECTOR_STATE_ON) SeenDetection = TRUE;
        if (stalta->debug.enabled) {
            stalta->debug.diff[i] = stalta->work.diff;
            stalta->debug.sta[i] = stalta->work.crnt.sta;
            stalta->debug.lta[i] = stalta->work.crnt.lta;
            stalta->debug.tla[i] = stalta->trigger.lta;
            stalta->debug.ratio[i] = stalta->work.crnt.ratio;
            stalta->debug.state[i] = stalta->work.crnt.state;
        }
    }

    stalta->state = SeenDetection ? DETECTOR_STATE_ON : DETECTOR_STATE_OFF;

    return stalta->state;
}
开发者ID:jandog8990,项目名称:asl-station-processor,代码行数:35,代码来源:stalta.c

示例9: OtherThreadFunc

int OtherThreadFunc(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10)
{
    Wait4State( BINARY_OTHER );

    Go2State( BINARY_OPPOSITE, "BINARY_OPPOSITE" );
    if( semGive( s_binary ) != OK )
        perror( "Error giving in BINARY_OTHER state" );

    Wait4State( COUNTING_OTHER );

    Go2State( COUNTING_OPPOSITE, "COUNTING_OPPOSITE" );
    if( semGive( s_counting ) != OK )
        perror( "Error giving in COUNTING_OTHER state" );

    Wait4State( MUTEX_OTHER_GIVE );
    if( semGive( s_mutex ) == OK )
        printf( "Error in MUTEX_OTHER_GIVE: give operation must fail, but it succeeded\n");

    Go2State( MUTEX_OTHER_WAIT, "MUTEX_OTHER_WAIT" );
    if( semTake( s_mutex, WAIT_FOREVER ) != OK )
        perror( "Error taking in MUTEX_OTHER_WAIT state" );

    CheckState(MUTEX_OTHER_WAIT, MUTEX_GIVE_ALL );

    Go2State( MUTEX_OPPOSITE_TO, "MUTEX_OPPOSITE_TO" );

    Wait4State( MUTEX_OPPOSITE_GIVE );
    if( semGive( s_mutex ) != OK )
        perror("Error giving in MUTEX_OPPOSITE_GIVE state");

    Wait4State( MUTEX_UNBLOCK );
    printf( "Other thread is complete.\n");

    return 0;
}
开发者ID:dubrousky,项目名称:v2lin,代码行数:35,代码来源:test_sem.c

示例10: MOZ_ASSERT

already_AddRefed<IDBFileRequest>
IDBFileHandle::GetMetadata(const IDBFileMetadataParameters& aParameters,
                           ErrorResult& aRv)
{
  MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!");

  // Common state checking
  if (!CheckState(aRv)) {
    return nullptr;
  }

  // Do nothing if the window is closed
  if (!CheckWindow()) {
    return nullptr;
  }

  nsRefPtr<MetadataParameters> params =
    new MetadataParameters(aParameters.mSize, aParameters.mLastModified);
  if (!params->IsConfigured()) {
    aRv.ThrowTypeError(MSG_METADATA_NOT_CONFIGURED);
    return nullptr;
  }

  nsRefPtr<FileRequestBase> fileRequest = GenerateFileRequest();

  nsRefPtr<MetadataHelper> helper =
    new MetadataHelper(this, fileRequest, params);

  if (NS_WARN_IF(NS_FAILED(helper->Enqueue()))) {
    aRv.Throw(NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR);
    return nullptr;
  }

  return fileRequest.forget().downcast<IDBFileRequest>();
}
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:35,代码来源:IDBFileHandle.cpp

示例11: AFX_MANAGE_STATE

// **********************************************************
//		Undo
// **********************************************************
STDMETHODIMP CUndoList::Undo(VARIANT_BOOL zoomToShape, VARIANT_BOOL* retVal)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	*retVal = VARIANT_FALSE;
	if (!CheckState()) return S_OK;

	IShapeEditor* editor = _mapCallback->_GetShapeEditor();

	if (_position >= 0) 
	{
		int pos = _position;
		int id = _list[pos]->BatchId;
		UndoListItem* item = _list[pos];

		while (_list[_position]->BatchId == id)
  	    {
			_position--;
			UndoSingleItem(_list[_position + 1]);
			if (_position < 0) break;
		}

		if (item->Operation != uoRemoveShape)
			ZoomToShape(zoomToShape, item->Operation == uoAddShape ? _position: pos);

		FireUndoListChanged();
		*retVal = VARIANT_TRUE;
	}
	return S_OK;
}
开发者ID:liuzhumei,项目名称:MapWinGIS,代码行数:32,代码来源:UndoList.cpp

示例12: ui

/**
 * @brief DialogEndLine create dialog
 * @param data container with data
 * @param parent parent widget
 */
DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
    :DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()), formula(QString()),
      angle(0), basePointId(0), formulaBaseHeight(0)
{
    ui->setupUi(this);
    InitVariables(ui);
    InitFormulaUI(ui);
    labelEditNamePoint = ui->labelEditNamePoint;
    this->formulaBaseHeight = ui->plainTextEditFormula->height();

    InitOkCancelApply(ui);
    flagFormula = false;
    flagName = false;
    CheckState();

    FillComboBoxPoints(ui->comboBoxBasePoint);
    FillComboBoxTypeLine(ui->comboBoxLineType);

    InitArrow(ui);

    connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogEndLine::PutHere);
    connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEndLine::PutVal);
    connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogEndLine::EvalFormula);
    connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged);
    connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEndLine::FormulaTextChanged);
    connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEndLine::DeployFormulaTextEdit);
}
开发者ID:jessikbarret,项目名称:Valentina,代码行数:32,代码来源:dialogendline.cpp

示例13: ui

/**
 * @brief DialogCutSplinePath create dialog.
 * @param data container with data
 * @param parent parent widget
 */
DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent)
    :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSplinePath), formula(QString()),
      splinePathId(NULL_ID), formulaBaseHeight(0), path(nullptr)
{
    ui->setupUi(this);
    InitVariables(ui);
    InitFormulaUI(ui);
    ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
    labelEditNamePoint = ui->labelEditNamePoint;
    this->formulaBaseHeight = ui->plainTextEditFormula->height();
    ui->plainTextEditFormula->installEventFilter(this);

    InitOkCancelApply(ui);
    flagFormula = false;
    CheckState();

    FillComboBoxSplinesPath(ui->comboBoxSplinePath);

    connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSplinePath::PutHere);
    connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSplinePath::PutVal);
    connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSplinePath::EvalFormula);
    connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSplinePath::NamePointChanged);
    connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged);
    connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit);

    path = new VisToolCutSplinePath(data);
}
开发者ID:a-dilla,项目名称:Valentina,代码行数:32,代码来源:dialogcutsplinepath.cpp

示例14: CheckState

void ChildSupervisor::HandleStateChanged(otChangedFlags aFlags)
{
    if ((aFlags & (OT_CHANGED_THREAD_ROLE | OT_CHANGED_THREAD_CHILD_ADDED | OT_CHANGED_THREAD_CHILD_REMOVED)) != 0)
    {
        CheckState();
    }
}
开发者ID:abtink,项目名称:openthread,代码行数:7,代码来源:child_supervision.cpp

示例15: CheckState

void JamDetector::HandleStateChanged(uint32_t aFlags)
{
    if (aFlags & OT_CHANGED_THREAD_ROLE)
    {
        CheckState();
    }
}
开发者ID:pvanhorn,项目名称:openthread,代码行数:7,代码来源:jam_detector.cpp


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