• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CheckState函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Reset

void UTransBuffer::Initialize(SIZE_T InMaxMemory)
{
	MaxMemory = InMaxMemory;
	// Reset.
	Reset( NSLOCTEXT("UnrealEd", "Startup", "Startup") );
	CheckState();

	UE_LOG(LogInit, Log, TEXT("Transaction tracking system initialized") );
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:9,代码来源:EditorTransaction.cpp


示例17: CheckState

void CButton::Update()
{
    m_oldState = m_state;
    m_state = ButtonStateNormal;
    
    CheckState();
    
    m_holdFrame = (ButtonStateHighlight == m_state) ? m_holdFrame + 1 : 0;
}
开发者ID:ttoApps,项目名称:wizapply_library_by_cpp_study,代码行数:9,代码来源:CButton.cpp


示例18: hy_GetDiskRoomSize

bool  CGameUpdate::UpdateBefore(__int64 qUpdateBytes)
{
	//check disk free room.
	wchar_t szLog[1024] = {0};
	qUpdateBytes += SAVE_DISK_ROOMSIZE;
	LARGE_INTEGER liSize = {0};
	hy_GetDiskRoomSize(m_strCliPath[0], &liSize);
	if (liSize.QuadPart >= qUpdateBytes)
		return true;
	
	//删除游戏,保证空间足够。
	if (m_dwUptFlag & UPDATE_FLAG_DELETE_GAME)
	{
		SetUpdateStatus(UPDATE_STATUS_DELETE_GAME);
		std::vector<tagGameInfo*> list;
		GetAllGameList(list);
		for (size_t idx=0; idx<list.size(); idx++)
		{
			if (!CheckState())
			{
				std::for_each(list.begin(), list.end(), Delete_Pointer<tagGameInfo>);
				return false;
			}

			tagGameInfo* pGame = list[idx];
			if (PathFileExistsA(pGame->CliPath) && pGame->CliPath[0] == m_strCliPath[0] &&
				lstrcmpiW(_bstr_t(pGame->CliPath), m_strCliPath.c_str()) != 0)
			{
				std::wstring str(_bstr_t(pGame->CliPath));
				std::wstring str2 = hy_ConvertPath(str);
				
				SetUpdateInfo(INFO_STR_DELETEGAME, str.c_str());

				DeleteGame(str2.c_str());
				hy_DyncaRefreDriver(str[0]);

				hy_GetDiskRoomSize(m_strCliPath[0], &liSize);
				if (liSize.QuadPart >= qUpdateBytes)
				{
					std::for_each(list.begin(), list.end(), Delete_Pointer<tagGameInfo>);
					return true;
				}
				else
				{
					swprintf_s(szLog, L"i8desk: free size:%dM, need size:%dM.", (DWORD)(liSize.QuadPart / 1000 / 1000),
						(DWORD)(qUpdateBytes / 1000 / 1000));
					OutputDebugStringW(szLog);
				}
			}
		}
		std::for_each(list.begin(), list.end(), Delete_Pointer<tagGameInfo>);
	}
	//空间不足,返回错误。
	SetErrorInfo(UPT_ERR_DISKNOROOM, (DWORD)(liSize.QuadPart / 1000 / 1000), (DWORD)(qUpdateBytes / 1000 / 1000));
	return false;
}
开发者ID:lubing521,项目名称:important-files,代码行数:56,代码来源:UpdateGame.cpp


示例19: CheckState

UTrackEntry* USpineSkeletonAnimationComponent::AddEmptyAnimation (int trackIndex, float mixDuration, float delay) {
	CheckState();
	if (state) {
		spTrackEntry* entry = spAnimationState_addEmptyAnimation(state, trackIndex, mixDuration, delay);
		UTrackEntry* uEntry = NewObject<UTrackEntry>();
		uEntry->SetTrackEntry(entry);
		trackEntries.Add(uEntry);
		return uEntry;
	} else return NewObject<UTrackEntry>();
}
开发者ID:PrettySimple,项目名称:spine-runtimes,代码行数:10,代码来源:SpineSkeletonAnimationComponent.cpp


示例20: UTransactor

UTransBuffer::UTransBuffer( const class FPostConstructInitializeProperties& PCIP, SIZE_T InMaxMemory )
:	UTransactor(PCIP)
,	MaxMemory( InMaxMemory )
{
	// Reset.
	Reset( NSLOCTEXT("UnrealEd", "Startup", "Startup") );
	CheckState();

	UE_LOG(LogInit, Log, TEXT("Transaction tracking system initialized") );
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:10,代码来源:EditorTransaction.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CheckStatsNode函数代码示例发布时间:2022-05-30
下一篇:
C++ CheckStableMaster函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap