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


C++ IsFlagSet函数代码示例

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


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

示例1: sm_ResetConVar

static cell_t sm_ResetConVar(IPluginContext *pContext, const cell_t *params)
{
	Handle_t hndl = static_cast<Handle_t>(params[1]);
	HandleError err;
	ConVar *pConVar;

	if ((err=g_ConVarManager.ReadConVarHandle(hndl, &pConVar))
		!= HandleError_None)
	{
		return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
	}

	pConVar->Revert();
	
#if SOURCE_ENGINE < SE_ORANGEBOX
	/* Should we replicate it? */
	if (params[3] && IsFlagSet(pConVar, FCVAR_REPLICATED))
	{
		ReplicateConVar(pConVar);
	}

	/* Should we notify clients? */
	if (params[4] && IsFlagSet(pConVar, FCVAR_NOTIFY))
	{
		NotifyConVar(pConVar);
	}
#endif

	return 1;
}
开发者ID:pmrowla,项目名称:sourcemod-1.5,代码行数:30,代码来源:smn_console.cpp

示例2: ADDTOCALLSTACK_INTENSIVE

bool CSector::CanSleep(bool fCheckAdjacents) const
{
	ADDTOCALLSTACK_INTENSIVE("CSector::CanSleep");
	if ( (g_Cfg._iSectorSleepDelay == 0) || IsFlagSet(SECF_NoSleep) )
		return false;	// never sleep
    if (m_Chars_Active.GetClientsNumber() > 0)
        return false;	// has at least one client, no sleep
	if ( IsFlagSet(SECF_InstaSleep) )
		return true;	// no active client inside, instant sleep
    
    if (fCheckAdjacents)
    {
        for (int i = 0; i < (int)DIR_QTY; ++i)// Check for adjacent's sectors sleeping allowance.
        {
            const CSector *pAdjacent = GetAdjacentSector((DIR_TYPE)i);    // set this as the last sector to avoid this code in the adjacent one and return if it can sleep or not instead of searching its adjacents.
            /*
            * Only check if this sector exist and it's not the last checked (sectors in the edges of the map doesn't have adjacent on those directions)
            * && Only check if the sector isn't sleeping (IsSleeping()) and then check if CanSleep().
            */
            if (!pAdjacent)
            {
                continue;
            }
            if (!pAdjacent->IsSleeping() || !pAdjacent->CanSleep(false))
            {
                return false;   // assume the base sector can't sleep.
            }
        }
    }

	//default behaviour;
	return ((g_World.GetCurrentTime().GetTimeRaw() - GetLastClientTime()) > g_Cfg._iSectorSleepDelay); // Sector Sleep timeout.
}
开发者ID:Sphereserver,项目名称:Source2,代码行数:33,代码来源:CSector.cpp

示例3: GetWindowLeft

// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CLTWnd::OnMouseMove
//
//	PURPOSE:	This is the actual mouse move handler
//
// ----------------------------------------------------------------------- //
BOOL CLTWnd::OnMouseMove(int xPos, int yPos)
{
	// Update the cursor's position on us
	m_xCursor = xPos - GetWindowLeft();
	m_yCursor = yPos - GetWindowTop();

	// Handle draggage if necessary
	if(s_pWndCapture == this)
	{
		if(IsFlagSet(LTWF_DRAGGABLE))
		{
			OnDrag(xPos,yPos);
		}
		else
		if(IsFlagSet(LTWF_PARENTDRAG))
		{
			// Drag our parent
			// Find our parent
			CLTWnd* pWnd = this;
			CLTWnd* pParent = m_pParentWnd;
			while(pWnd->IsFlagSet(LTWF_FIXEDCHILD) && pParent)
			{
				pWnd = pParent;
				pParent = pWnd->GetParent();
			}
			pWnd->OnDrag(xPos,yPos);
		}
	}

	return(this != s_pMainWnd);
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:38,代码来源:LtWnd.cpp

示例4: FX_ASSERT_MESSAGE

//--------------------------------------------------------------------------------------------------
// Name: SetActive
// Desc: Sets active status
//--------------------------------------------------------------------------------------------------
void CGameEffect::SetActive(bool isActive)
{
	FX_ASSERT_MESSAGE(IsFlagSet(GAME_EFFECT_INITIALISED),"Effect changing active status without being initialised first");
	FX_ASSERT_MESSAGE((IsFlagSet(GAME_EFFECT_RELEASED)==false),"Effect changing active status after being released");

	SetFlag(GAME_EFFECT_ACTIVE,isActive);
	GAME_FX_SYSTEM.RegisterEffect(this); // Re-register effect with game effects system
}//-------------------------------------------------------------------------------------------------
开发者ID:amrhead,项目名称:eaascode,代码行数:12,代码来源:GameEffect.cpp

示例5: ReplicateConVar

void ConsoleVariableType::SetBool(bool value, bool replicate, bool notify) {
	ConVarInstance->SetValue(value ? 1 : 0);

#if SOURCE_ENGINE < SE_ORANGEBOX
	if(replicate && IsFlagSet(ConVarInstance, FCVAR_REPLICATED)) {
		ReplicateConVar(ConVarInstance);
	}

	if(notify && IsFlagSet(ConVarInstance, FCVAR_NOTIFY)) {
		NotifyConVar(ConVarInstance);
	}
#endif
}
开发者ID:KissLick,项目名称:viper,代码行数:13,代码来源:ConsoleVariableType.cpp

示例6: Write

void plAgeLinkStruct::Write( hsStream * s, hsResMgr* m)
{
    s->WriteLE( fFlags );
    if ( IsFlagSet( kHasAgeInfo ) )
        fAgeInfo.Write( s,m );
    if ( IsFlagSet( kHasLinkingRules ) )
        s->WriteLE( fLinkingRules );
    if ( IsFlagSet( kHasSpawnPt ) )
        fSpawnPoint.Write( s );
    if ( IsFlagSet( kHasAmCCR ) )
        s->WriteLE( fAmCCR );
    if ( IsFlagSet( kHasParentAgeFilename ) )
        plMsgStdStringHelper::Poke(fParentAgeFilename,s);
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:14,代码来源:plNetServerSessionInfo.cpp

示例7: IsEqualTo

bool plNetServerSessionInfo::IsEqualTo(const plNetServerSessionInfo * other) const
{
    bool match = true;
    if (match && IsFlagSet(kHasServerGuid) && other->IsFlagSet(kHasServerGuid))
        match = match && fServerGuid.IsEqualTo(other->GetServerGuid());
    if (match && IsFlagSet(kHasServerName) && other->IsFlagSet(kHasServerName))
        match = match && (stricmp(fServerName.c_str(),other->fServerName.c_str())==0);
    if (match && IsFlagSet(kHasServerType) && other->IsFlagSet(kHasServerType))
        match = match && fServerType==other->fServerType;
    if (match && IsFlagSet(kHasServerAddr) && other->IsFlagSet(kHasServerAddr))
        match = match && (stricmp(fServerAddr.c_str(),other->fServerAddr.c_str())==0);
    if (match && IsFlagSet(kHasServerPort) && other->IsFlagSet(kHasServerPort))
        match = match && fServerPort==other->fServerPort;
    return match;
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:15,代码来源:plNetServerSessionInfo.cpp

示例8: GetName

//--------------------------------------------------------------------------------------------------
// Name: Initialise
// Desc: Initializes game effect
//--------------------------------------------------------------------------------------------------
void CGameEffect::Initialise(const SGameEffectParams* gameEffectParams)
{
#if DEBUG_GAME_FX_SYSTEM
	m_debugName = GetName(); // Store name so it can be accessed in destructor and debugging
#endif

	if(!IsFlagSet(GAME_EFFECT_INITIALISED))
	{
		SGameEffectParams params;
		if(gameEffectParams)
		{
			params = *gameEffectParams;
		}

		SetFlag(GAME_EFFECT_AUTO_UPDATES_WHEN_ACTIVE,params.autoUpdatesWhenActive);
		SetFlag(GAME_EFFECT_AUTO_UPDATES_WHEN_NOT_ACTIVE,params.autoUpdatesWhenNotActive);
		SetFlag(GAME_EFFECT_AUTO_RELEASE,params.autoRelease);
		SetFlag(GAME_EFFECT_AUTO_DELETE,params.autoDelete);

		GAME_FX_SYSTEM.RegisterEffect(this);

		SetFlag(GAME_EFFECT_INITIALISED,true);
		SetFlag(GAME_EFFECT_RELEASED,false);
	}
}//-------------------------------------------------------------------------------------------------
开发者ID:amrhead,项目名称:eaascode,代码行数:29,代码来源:GameEffect.cpp

示例9: throw

bool Entity::Update( float ticks ) throw(std::exception)
{
    if ( IsFlagSet( Entity::F_ENABLE )) {
        DoUpdate(ticks);
    }
    return false;
}
开发者ID:juergen0815,项目名称:sdl-3d-chart,代码行数:7,代码来源:entity.cpp

示例10: InternalSetFloatValue

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *value - 
//-----------------------------------------------------------------------------
void ConVar::InternalSetFloatValue( float fNewValue )
{
	if ( fNewValue == m_fValue )
		return;

	if ( IsFlagSet( FCVAR_MATERIAL_THREAD_MASK ) )
	{
		if ( g_pCVar && !g_pCVar->IsMaterialThreadSetAllowed() )
		{
			g_pCVar->QueueMaterialThreadSetValue( this, fNewValue );
			return;
		}
	}

	Assert( m_pParent == this ); // Only valid for root convars.

	// Check bounds
	ClampValue( fNewValue );

	// Redetermine value
	float flOldValue = m_fValue;
	m_fValue		= fNewValue;
	m_nValue		= ( int )m_fValue;

	if ( !( m_nFlags & FCVAR_NEVER_AS_STRING ) )
	{
		char tempVal[ 32 ];
		Q_snprintf( tempVal, sizeof( tempVal), "%f", m_fValue );
		ChangeStringValue( tempVal, flOldValue );
	}
	else
	{
		Assert( !m_fnChangeCallback );
	}
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:39,代码来源:convar.cpp

示例11: statusID

// ---------------------------------------------------------
// CNSmlCmdsBase::StatusToUnsupportedCommandL()
// Makes status data to unsupported or illegal SyncML command
// ---------------------------------------------------------
EXPORT_C void CNSmlCmdsBase::StatusToUnsupportedCommandL( TBool aIllegal, const TDesC8& aCmd, const SmlPcdata_t* aCmdRef, Flag_t aFlags )
	{
	if ( iStatusToServer )
		{
		TInt statusID( 0 );
		statusID = iStatusToServer->CreateNewStatusElementL(); 
		iStatusToServer->SetCmdRefL( statusID, aCmdRef );
		iStatusToServer->SetCmdL( statusID, aCmd ); 
		if ( iStatusToServerNoResponse || IsFlagSet( aFlags, SmlNoResp_f ) )
			{
			iStatusToServer->SetNoResponse( statusID, ETrue );
			}
		else
			{
			iStatusToServer->SetNoResponse( statusID, EFalse );
			}
		if ( aIllegal )
			{
			iStatusToServer->SetStatusCodeL( statusID, TNSmlError::ESmlStatusCommandFailed );
			}
		else
			{
			iStatusToServer->SetStatusCodeL( statusID, TNSmlError::ESmlStatusOptFeatureNotSupported );
			}
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:30,代码来源:nsmlcmdsbase.cpp

示例12: NS_ENSURE_TRUE

HRESULT
MFTDecoder::SetMediaTypes(IMFMediaType* aInputType,
                          const GUID& aOutputSubType)
{
  mOutputSubtype = aOutputSubType;

  // Set the input type to the one the caller gave us...
  HRESULT hr = mDecoder->SetInputType(0, aInputType, 0);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  hr = SetDecoderOutputType();
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  hr = mDecoder->GetInputStreamInfo(0, &mInputStreamInfo);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  hr = mDecoder->GetOutputStreamInfo(0, &mOutputStreamInfo);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  mMFTProvidesOutputSamples = IsFlagSet(mOutputStreamInfo.dwFlags, MFT_OUTPUT_STREAM_PROVIDES_SAMPLES);

  hr = SendMFTMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, 0);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  hr = SendMFTMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, 0);
  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);

  return S_OK;
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:29,代码来源:MFTDecoder.cpp

示例13: fb_dbinfoclass_getaccess

/*
*	Get the access rights for the dbinfo object or its variables
*/
OV_DLLFNCEXPORT OV_ACCESS fb_dbinfoclass_getaccess(
	OV_INSTPTR_ov_object		pobj,
	const OV_ELEMENT			*pelem,
	const OV_TICKET				*pticket
) {
	/*
	*	local variables
	*/
	OV_INSTPTR_fb_dbinfoclass	pdbi = Ov_StaticPtrCast(fb_dbinfoclass, pobj);

	/*
	*	switch based on the element's type
	*/
	switch(pelem->elemtype) {
		case OV_ET_VARIABLE:
			if(pelem->elemunion.pvar->v_offset >= offsetof(OV_INST_ov_object,__classinfo)) {

		        if(IsFlagSet(pelem->elemunion.pvar->v_flags, 'i')) {
					return OV_AC_READWRITE;
				}
				return OV_AC_READ;
			}
			break;
		case OV_ET_OBJECT:
			/* Gibt es schon FB-Instanzen? */
			if( pdbi->v_instnumber || pdbi->v_tasknumber || pdbi->v_connnumber ) {
			    return OV_AC_READWRITE;
			}
			return (OV_AC_READWRITE | OV_AC_DELETEABLE);
		default:
			break;
	}
	return ov_object_getaccess(pobj, pelem, pticket);
}
开发者ID:acplt,项目名称:rte,代码行数:37,代码来源:fb_dbinfo.c

示例14: GetCode

  //---------------------------------------------------------------------------
  string_type Value::AsciiDump() const
  {
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; pos=") << GetExprPos();
    ss << _T("; type=\"") << GetType() << _T("\"");
    ss << _T("; val=");

    switch(m_cType)
    {
    case 'i': ss << (int_type)m_val.real(); break;
    case 'f': ss << m_val.real(); break;
    case 'm': ss << _T("(matrix)"); break;
    case 's': 
              assert(m_psVal!=nullptr);
              ss << _T("\"") << m_psVal << _T("\""); break;
    }

    ss << ((IsFlagSet(IToken::flVOLATILE)) ? _T("; ") : _T("; not ")) << _T("vol");
    ss << _T("]");

    return ss.str();
  }
开发者ID:boussaffawalid,项目名称:OTB,代码行数:26,代码来源:mpValue.cpp

示例15: GetCode

//-----------------------------------------------------------------------------------------------
string_type Variable::AsciiDump() const
{
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; id=\"") << GetIdent() << _T("\"");
    ss << _T("; type=\"") << GetType() << _T("\"");
    ss << _T("; val=");

    switch(GetType())
    {
    case 'i':
        ss << (int_type)GetFloat();
        break;
    case 'f':
        ss << GetFloat();
        break;
    case 'm':
        ss << _T("(array)");
        break;
    case 's':
        ss << _T("\"") << GetString() << _T("\"");
        break;
    }

    ss << ((IsFlagSet(IToken::flVOLATILE)) ? _T("; ") : _T("; not ")) << _T("volatile");
    ss << _T("]");

    return ss.str();
}
开发者ID:QwZhang,项目名称:gale,代码行数:32,代码来源:mpVariable.cpp


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