當前位置: 首頁>>代碼示例>>C++>>正文


C++ AssertEx函數代碼示例

本文整理匯總了C++中AssertEx函數的典型用法代碼示例。如果您正苦於以下問題:C++ AssertEx函數的具體用法?C++ AssertEx怎麽用?C++ AssertEx使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AssertEx函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: AssertEx

TIMESTAMP_STRUCT* CAutoTableManager::GetTableItemInLineAsDATETIME(UINT uItemIndex, UINT uLineIndex)
{
    m_pDataTime = (TIMESTAMP_STRUCT*)this->GetTableItemInLine(uItemIndex, uLineIndex);
    AssertEx(AL_NORMAL, m_pDataTime,_T("m_pDataTime為空,函數失敗"));
    AssertEx(AL_NORMAL, (m_pAi[uItemIndex].m_pAta == MS_SQL_TYPE_DATETIME),_T("類型不匹配,錯誤傳參"));
    return m_pDataTime;
}
開發者ID:ueverything,項目名稱:mmo-resourse,代碼行數:7,代碼來源:MsAutoTableManager.cpp

示例2: AssertEx

		BOOL GaiBangSkill004_T::EffectOnUnitOnce(Obj_Character& rMe, Obj_Character& rTar, BOOL bCriticalFlag) const
		{
			__ENTER_FUNCTION
			SkillInfo_T& rSkillInfo = rMe.GetSkillInfo();
			TargetingAndDepletingParams_T& rParams = rMe.GetTargetingAndDepletingParams();

			INT nDepleteStrikePointSegment = rParams.GetDepletedStrikePoints()/STRIKE_POINT_SEGMENT_SIZE;
			if(1>nDepleteStrikePointSegment)
			{
				AssertEx(FALSE,"[GaiBangSkill004_T::TakeEffectNow]: Depleted strike point segment illegal!");
				nDepleteStrikePointSegment=1;
			}
			else if(MAX_STRIKE_POINT_SEGMENT<nDepleteStrikePointSegment)
			{
				AssertEx(FALSE,"[GaiBangSkill004_T::TakeEffectNow]: Depleted strike point segment illegal!");
				nDepleteStrikePointSegment=MAX_STRIKE_POINT_SEGMENT;
			}
			INT nAdditionalAttackPower = rSkillInfo.GetDescriptorByIndex(nDepleteStrikePointSegment)->GetValue();
			// init impact1
			OWN_IMPACT impact;
			
			CombatCore_T myCombatCore;
			myCombatCore.Reset();			
			myCombatCore.SetAdditionalAttackLight(nAdditionalAttackPower);
			myCombatCore.GetResultImpact(rMe, rTar, impact);

			// register impact event
			RegisterImpactEvent(rTar, rMe, impact, rParams.GetDelayTime(), bCriticalFlag);
			return TRUE;
			__LEAVE_FUNCTION
			return FALSE;
		}
開發者ID:brock7,項目名稱:TianLong,代碼行數:32,代碼來源:GaiBangSkill004.cpp

示例3: CMsPacketFactory

// DllGame啟動線程函數
DWORD WINAPI RrTetris::RrTetrisThread(LPVOID)
{
    RrTetris::gs_lpCMsPacketFactory = NEW CMsPacketFactory(DG2S_PACKET_MAX_COUNT);
    AssertEx(AL_CATAST, gs_lpCMsPacketFactory, _T("內存不足"));
    RrTetris::gs_lpCMsPacketFactory->Register(g_lpCMsBasePacket, PACKET_MAX_COUNT);

    RrTetrisWritePacket(0,NULL);

    // 等待基本初始化
    while(!g_IsMsBaseInit)
    {
        NO_CONTINUOUS;
    }

    // 申請日誌對象
    RrTetris::gs_pMsLog = NEW CMsLog(_T("%s/Log/Dll_RrTetris_C.log"), TRUE);
    AssertEx(AL_CATAST, gs_pMsLog, _T("內存不足"));

    // 申請配置對象
    RrTetris::gs_pRrTetrisConfig = NEW CMsIni(_T("%s/RrTetris/RrTetris.ini"));
    AssertEx(AL_CATAST, gs_pRrTetrisConfig, _T("內存不足"));


    ::PostThreadMessage(gs_dwGameStationLogicThreadId, MSM_DLL_EXIT, 0, 0);
    SAFE_DELETE(RrTetris::gs_lpCMsPacketFactory);

    // 等待基本釋放
    while(g_IsMsBaseInit)
    {
        NO_CONTINUOUS;
    }
    return 0;
}
開發者ID:ueverything,項目名稱:mmo-resourse,代碼行數:34,代碼來源:RrTetris_S.cpp

示例4: Assert

uint CGLockTargetHandler::Execute( CGLockTarget* pPacket, Player* pPlayer )
{
	__ENTER_FUNCTION

	GamePlayer* pGamePlayer = (GamePlayer*)pPlayer ;
	Assert( pGamePlayer ) ;

	Obj_Human* pHuman = pGamePlayer->GetHuman() ;

	if(NULL==pHuman)
	{
		AssertEx(FALSE,"[CGLockTargetHandler::Execute]: NULL Obj_Human pointer found!!");
		return PACKET_EXE_ERROR ;
	}
	Scene* pScene = pHuman->getScene() ;
	if( pScene==NULL )
	{
		Assert(FALSE) ;
		return PACKET_EXE_ERROR ;
	}

	//檢查線程執行資源是否正確
	Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;

	ObjID_t nMeID = pHuman->GetID();
	if( nMeID == INVALID_ID )
	{
		Assert(FALSE) ;
		return PACKET_EXE_ERROR ;
	}
	//update target
	if(NULL==pPacket)
	{
		AssertEx(FALSE,"[CGLockTargetHandler::Execute]: NULL packet pointer found!!");
		return PACKET_EXE_ERROR ;
	}

	pHuman->SetLockedTarget(pPacket->getTargetID());
	// 當鎖定的目標是NPC時將會觸發NPC的泡泡說話
	Obj* pTarget = pScene->GetObjManager()->GetObj(pPacket->getTargetID());
	if (pTarget->GetObjType() == Obj::OBJ_TYPE_MONSTER)
	{
		((Obj_Monster*)pTarget)->ProcessPaoPao();
	}
	
	g_pLog->FastSaveLog( LOG_FILE_1, "CGLockTargetHandler: ok obj=%d scene=%d", 
		nMeID, pScene->SceneID() ) ;

	return PACKET_EXE_CONTINUE ;

	__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
開發者ID:ueverything,項目名稱:mmo-resourse,代碼行數:54,代碼來源:CGLockTargetHandler.cpp

示例5: AssertEx

VOID PNGAPI CMsPngImage::FlushPng(png_structp png_ptr)
{
    CMsPngImage* pPngImage = (CMsPngImage*)png_get_io_ptr(png_ptr);

    if (pPngImage->m_hFile)
    {
        BOOL bRet = ::FlushFileBuffers(pPngImage->m_hFile);
        AssertEx(bRet, _T("寫入圖片失敗"));
    }
    else
    {
        AssertEx(pPngImage->m_hFile, _T("寫入圖片失敗"));
    }
}
開發者ID:ueverything,項目名稱:mmo-resourse,代碼行數:14,代碼來源:MsPngImage.cpp

示例6: switch

// 初始化表格管理器
BOOL CAutoTableManager::Init(VOID)
{
    _ENTER_FUN_C;

    for (UINT i = 0; i < m_uItemCount; i++)
    {
        switch (m_pAi[i].m_pAta)
        {
        case MS_SQL_TYPE_INT:
            {
                m_pInt = new INT[m_uLineCount];
                AssertEx(AL_NORMAL, m_pInt, _T("m_pInt為空,內存不足"));
                ZeroMemory(m_pInt, sizeof(INT) * m_uLineCount);
                m_pAi[i].m_lpItem = m_pInt;
            }break;
        case MS_SQL_TYPE_TCHAR:
            {
                m_pTchar = new TCA[m_uLineCount];
                AssertEx(AL_NORMAL, m_pTchar, _T("m_pInt為空,內存不足"));
                ZeroMemory(m_pTchar, sizeof(TCA) * m_uLineCount);
                m_pAi[i].m_lpItem = m_pTchar;
            }break;
        case MS_SQL_TYPE_FLOAT:
            {
                m_pFloat = new FLOAT[m_uLineCount];
                AssertEx(AL_NORMAL, m_pFloat, _T("m_pInt為空,內存不足"));
                ZeroMemory(m_pFloat, sizeof(FLOAT) * m_uLineCount);
                m_pAi[i].m_lpItem = m_pFloat;
            }break;
        case MS_SQL_TYPE_DATETIME:
            {
                m_pDataTime = new TIMESTAMP_STRUCT[m_uLineCount];
                AssertEx(AL_NORMAL, m_pDataTime, _T("m_pInt為空,內存不足"));
                ZeroMemory(m_pDataTime, sizeof(TIMESTAMP_STRUCT) * m_uLineCount);
                m_pAi[i].m_lpItem = m_pDataTime;
            }break;
        default:
            {
                AssertEx(AL_NORMAL, FALSE,_T("無效類型,錯誤邏輯"));
            }
        }
    }
    m_uValidLine = 0;
    m_IsInit = TRUE;
    // 返回成功
    return TRUE;

    _LEAVE_FUN_DISPOSE_END_C;
    return FALSE;
}
開發者ID:ueverything,項目名稱:mmo-resourse,代碼行數:51,代碼來源:MsAutoTableManager.cpp

示例7: CMsPacketFactory

// DllGame啟動線程函數
DWORD WINAPI RrTetris::RrTetrisThread(LPVOID)
{
    RrTetris::gs_lpCMsPacketFactory = NEW CMsPacketFactory(DG2S_PACKET_MAX_COUNT);
    AssertEx(AL_CATAST, gs_lpCMsPacketFactory, _T("內存不足"));
    RrTetris::gs_lpCMsPacketFactory->Register(g_lpCMsBasePacket, PACKET_MAX_COUNT);

    RrTetris::gs_pCMsBaseRun = NEW CMsBaseRun(_T("%s/Log/Dll_RrTetris_Assertx.log"), _T("RrTetrisClass"), _T("RrTetris"), RrTetrisHookProc, RrTetrisWndProc, NULL);
    AssertEx(AL_CATAST, gs_pCMsBaseRun, _T("內存不足"));
    S_2DEngineWndInfo s_ewi;
    s_ewi.m_bTopMost= FALSE;
    s_ewi.m_nX      = CW_USEDEFAULT;
    s_ewi.m_nY      = 0;
    s_ewi.m_nWidth  = CW_USEDEFAULT;
    s_ewi.m_nHeight = 0;
    s_ewi.m_dwStyle = WS_OVERLAPPEDWINDOW;

    // 等待基本初始化
    while(!g_IsMsBaseInit)
    {
        NO_CONTINUOUS;
    }

    // 申請日誌對象
    RrTetris::gs_pMsLog = NEW CMsLog(_T("%s/Log/Dll_RrTetris_C.log"), TRUE);
    AssertEx(AL_CATAST, gs_pMsLog, _T("內存不足"));

    // 申請配置對象
    RrTetris::gs_pRrTetrisConfig = NEW CMsIni(_T("%s/RrTetris/RrTetris.ini"));
    AssertEx(AL_CATAST, gs_pRrTetrisConfig, _T("內存不足"));

    RrTetris::gs_hModule = ::GetModuleHandle(_T("Dll_RrTetris_C.dll"));
    RrTetris::gs_hInstance = (HINSTANCE)RrTetris::gs_hModule;
    if (RrTetris::gs_hInstance)
    {
        g_pCMsWinMain->Init(RrTetris::gs_hInstance, NULL, _T(""), SW_SHOW, &s_ewi);
        g_pCMsWinMain->Run();
        g_pCMsWinMain->WaitQuit();
    }
    ::PostThreadMessage(gs_dwGameStationLogicThreadId, MSM_DLL_EXIT, (WPARAM)RrTetris::gs_hModule, 0);
    SAFE_DELETE(RrTetris::gs_pCMsBaseRun);
    SAFE_DELETE(RrTetris::gs_lpCMsPacketFactory);

    // 等待基本釋放
    while(g_IsMsBaseInit)
    {
        NO_CONTINUOUS;
    }
    return 0;
}
開發者ID:xiongshaogang,項目名稱:mmo-resourse,代碼行數:50,代碼來源:RrTetris_C.cpp

示例8: m_width

Bitmap::Bitmap(int width, int height, int bpp)
 : m_width(width), m_height(height), m_bpp(bpp), m_data(NULL) {
	AssertEx(m_bpp == 1 || m_bpp == 8 || m_bpp == 16 || m_bpp == 24 || m_bpp == 32
		|| m_bpp == 96 || m_bpp == 128, "Invalid number of bits per pixel");
	AssertEx(width > 0 && height > 0, "Invalid bitmap size");

	if (bpp == 96 || bpp == 128)
		m_gamma = 1.0f;
	else
		m_gamma = -1.0f; // sRGB

	// 1-bit masks are stored in a packed format. 
	m_size = (size_t) std::ceil(((double) m_width * m_height * m_bpp) / 8.0);
	m_data = static_cast<uint8_t *>(allocAligned(m_size));
}
開發者ID:joewan,項目名稱:mitsuba-renderer,代碼行數:15,代碼來源:bitmap.cpp

示例9: AssertEx

 VOID StdImpact030_T::OnFadeOut(OWN_IMPACT& rImp, Obj_Character& rMe) const
 {
     __ENTER_FUNCTION
     Obj_Character* pTar=NULL;
     Scene* pScene = rMe.getScene();
     if(NULL==pScene)
     {
         AssertEx(FALSE, "[StdImpact030_T::OnFadeOut]: Empty scene pointer found!!");
         return;
     }
     OBJLIST Targets;
     if(FALSE==ScanUnitForTarget(rImp, rMe, *(rMe.getWorldPos()), (FLOAT)GetScanRadius(rImp), GetEffectedObjCount(rImp), Targets))
     {
         return;
     }
     INT nImpact = GetSubImpactIndex(rImp);
     if(INVALID_ID==nImpact)
     {
         return;
     }
     // impacts init finished
     for(INT nIdx=0; Targets.m_Count>nIdx;++nIdx)
     {
         pTar = (Obj_Character*)Targets.m_aObj[nIdx];
         if(NULL!=pTar)
         {
             pScene->GetEventCore().RegisterBeSkillEvent(pTar->GetID(), rMe.GetID(), BEHAVIOR_TYPE_HOSTILITY, 500);
             g_ImpactCore.SendImpactToUnit(*pTar, nImpact, rMe.GetID(), 500);
         }
     }
     return;
     __LEAVE_FUNCTION
 }
開發者ID:gangzi4494,項目名稱:web-pap,代碼行數:33,代碼來源:StdImpact030.cpp

示例10: sprintf

VOID SceneTimer::FreeTimer(INT index)
{
	if( index <0 || index >= maxCount )
	{
#ifdef _DEBUG
		CHAR szTemp[MAX_FILE_PATH];
		sprintf(szTemp,"index = %d",index);
		AssertEx(FALSE,szTemp) ;
#endif
		return ;
	}

	InitOne(index);//釋放時初始化

	MyTimer* temp = (MyTimer*)&(m_pTimers[index]);

	*((MyTimer**)temp) =  head;

	head = temp;	


#if _DEBUG
	m_currentUse--;
#endif

}
開發者ID:ueverything,項目名稱:mmo-resourse,代碼行數:26,代碼來源:SceneTimer.cpp

示例11: MyGetCurrentThreadID

UINT    LBAskAuthHandler::Execute(LBAskAuth* pPacket, Player* pPlayer )
{
    __ENTER_FUNCTION
        
        TID CurrentThreadID = MyGetCurrentThreadID();
        
        if(CurrentThreadID == g_pServerManager->m_ThreadID)
        {
            Assert(pPacket);

            ServerPlayer* pServerPlayer  = (ServerPlayer*)pPlayer;

            Assert(pServerPlayer);

            pServerPlayer->SendPacket(pPacket);
        }
        else
        {
            AssertEx(FALSE,"LBAskAuthHandler 線程資源執行錯誤!");
        }
        
        Log::SaveLog(LOGIN_LOGFILE,"LBAskAuthHandler::Execute() ....OK");

        return PACKET_EXE_CONTINUE;

    __LEAVE_FUNCTION

        return PACKET_EXE_ERROR;
}
開發者ID:gangzi4494,項目名稱:web-pap,代碼行數:29,代碼來源:LBAskAuthHandler.cpp

示例12: AreaLuminaire

	AreaLuminaire(const Properties &props) : Luminaire(props), m_shape(NULL) {
		AssertEx(m_luminaireToWorld.isIdentity(), "Error: non-identity transformation found. "
			"Area luminaires inherit their transformation from their associated shape!");
		m_intensity = props.getSpectrum("intensity", Spectrum(1));
		m_type = EDiffuseDirection | EOnSurface;
		m_intersectable = true;
	}
開發者ID:joewan,項目名稱:mitsuba-renderer,代碼行數:7,代碼來源:area.cpp

示例13: Assert

KVOID Kylin::Scene::SpawnScene()
{
    Assert(KylinRoot::GetSingletonPtr()->GetGameFramePtr());
    m_pSceneLoader = KylinRoot::GetSingletonPtr()->GetGameFramePtr()->CreateSceneLoader();

    //-----------------------------------------------------------------
    // ╪стьЁ║╬╟
    Ogre::FileInfoListPtr resPtr = Ogre::ResourceGroupManager::getSingletonPtr()->findResourceFileInfo("General", m_kSceneHag.m_sSceneFile);
    Ogre::FileInfo fInfo = (*(resPtr->begin()));

    KSTR sName = fInfo.archive->getName();
    sName += "/" + m_kSceneHag.m_sSceneFile;
    //------------------------------------------------------------------
    // ╪сть╠Ё╬╟рТюж

    KylinRoot::GetSingletonPtr()->CreateSound("$BackgroundSound",m_kSceneHag.m_nBgSound);

    //------------------------------------------------------------------
    // ж╢ппluaнд╪Ч
    KSTR sLua = StringUtils::replace(sName,".xml",".lua");
    OgreRoot::GetSingletonPtr()->GetScriptVM()->ExecuteScriptFile(sLua.data());
    //-----------------------------------------------------------------
    // ╪стьlevel
    m_pSceneLoader->LoadLevel(m_kSceneHag.m_sSceneFile);
    //-----------------------------------------------------------------
    // ╪стьЁ║╬╟ё╛NPC╣х
    if (!m_pSceneLoader->LoadScene(m_kSceneHag.m_sSceneFile))
    {
        AssertEx(NULL,"Ё║╬╟╪стьй╖╟эё║");
        return;
    }
    //-----------------------------------------------------------------
    // ╪стьмФ╪р
    m_pSceneLoader->LoadPlayer();
}
開發者ID:dzw,項目名稱:kylin001v,代碼行數:35,代碼來源:Scene.cpp

示例14: _snprintf

	VOID DBCFile::CreateIndex(INT nColum, const CHAR* szFileName)
	{
		if(nColum <0 || nColum >= m_nFieldsNum || m_nIndexColum==nColum) return;

		m_hashIndex.clear();

		for(INT i=0; i<(INT)m_nRecordsNum; i++)
		{
			FIELD* p = &(m_vDataBuf[i*m_nFieldsNum]);

			FIELD_HASHMAP::iterator itFind = m_hashIndex.find(p->iValue);
			if(itFind != m_hashIndex.end())
			{
				CHAR szTemp[260];
				_snprintf(szTemp, 260, "[%s]Multi index at line %d(SAME:value=%d)", szFileName, i+1, p->iValue);
#ifdef GAME_CLIENT
				throw std::exception(szTemp);
#else
				AssertEx(FALSE,szTemp);
#endif
				return;
			}
			m_hashIndex.insert(std::make_pair(p->iValue, p));
		}
	}
開發者ID:gitrider,項目名稱:wxsj2,代碼行數:25,代碼來源:WXSJ_DBC.cpp

示例15: MyGetCurrentThreadID

UINT SSScenePlayerCountHandler::Execute(SSScenePlayerCount* pPacket, Player* pPlayer )
{
    __ENTER_FUNCTION    
    
        TID CurrentThreadID = MyGetCurrentThreadID();

        if(CurrentThreadID == g_pServerManager->m_ThreadID)
        {
            //修改g_WorldPlayerCounter 中數據
            Assert(pPacket);
            g_WorldPlayerCounter.m_WorldPlayerCount = pPacket->GetTotalPlayerCount();
            //修改場景負載數據
            //todo..
        }
        else
        {
            AssertEx(FALSE,"SSScenePlayerCountHandler 線程資源執行錯誤!");
        }
        
        Log::SaveLog(LOGIN_LOGFILE,"SSScenePlayerCountHandler::Execute()....OK,WorldPlayerCount = %d",
            g_WorldPlayerCounter.m_WorldPlayerCount);
        return PACKET_EXE_CONTINUE;

    __LEAVE_FUNCTION    

        return PACKET_EXE_ERROR;
}
開發者ID:gangzi4494,項目名稱:web-pap,代碼行數:27,代碼來源:SSScenePlayerCountHandler.cpp


注:本文中的AssertEx函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。