本文整理汇总了C++中GT_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ GT_ASSERT函数的具体用法?C++ GT_ASSERT怎么用?C++ GT_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GT_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GT_ASSERT
//设置事件
bool CRequestSocket::SetEventService(IUnknownEx * pIUnknownEx)
{
GT_ASSERT(pIUnknownEx!=NULL);
m_pIEventService=GET_OBJECTPTR_INTERFACE(pIUnknownEx,IEventService);
GT_ASSERT(m_pIEventService!=NULL);
return (m_pIEventService!=NULL);
}
示例2: GT_ASSERT
//开始服务
bool __cdecl CQueueService::StartService(BYTE cbThreadCount)
{
//效验参数
GT_ASSERT(m_bService==false);
GT_ASSERT(m_hCompletionPort==NULL);
GT_ASSERT(m_pIQueueServiceSink!=NULL);
m_cbThreadCount = cbThreadCount;
m_hCompletionPort = new HANDLE[m_cbThreadCount];
memset(m_hCompletionPort, 0, sizeof(HANDLE) * m_cbThreadCount);
m_QueueServiceThread = new CQueueServiceThread[m_cbThreadCount];
for(BYTE i = 0; i < m_cbThreadCount; i ++)
{
//建立完成端口
m_hCompletionPort[i]=CreateIoCompletionPort(INVALID_HANDLE_VALUE,NULL,NULL,1);
if (m_hCompletionPort[i]==NULL) throw TEXT("队列对象完成端口创建失败");
//启动线程
if (m_QueueServiceThread[i].InitThread(m_hCompletionPort[i], i)==false) throw TEXT("队列对象线程初始化失败");
if (m_QueueServiceThread[i].StartThead()==false) throw TEXT("队列对象线程启动失败");
}
//设置参数
m_bService=true;
return true;
}
示例3: GT_ASSERT
bool __cdecl CCalculateSink::InitCalculateSink(ITableFrame *pITableFrame,
CTableFrameSink *pTableFrameSink)
{
m_pITableFrame=pITableFrame;
if (m_pITableFrame==NULL) return false;
m_pTableFrameSink = pTableFrameSink;
GT_ASSERT(m_pTableFrameSink != NULL);
//获取参数
m_pGameServiceAttrib=m_pITableFrame->GetGameServiceAttrib();
GT_ASSERT(m_pGameServiceAttrib!=NULL);
m_pGameServiceOption=m_pITableFrame->GetGameServiceOption();
GT_ASSERT(m_pGameServiceOption!=NULL);
m_pICalculateFrame = m_pITableFrame->GetICalculateFrame();
GT_ASSERT(m_pICalculateFrame != NULL);
memset(&m_decAfterTax, 0, sizeof(DECIMAL));
DECIMAL decTemp;
memset(&decTemp, 0, sizeof(DECIMAL));
VarDecFromI4(-1, &decTemp);
VarDecMul(&decTemp,(DECIMAL*) &m_pGameServiceOption->decTaxRate, &m_decAfterTax);
return true;
}
示例4: lseek
HRESULT
CaPerfDataWriter::writeFakeTimerInfo(caperf_section_fake_timer_t* pInfo)
{
HRESULT ret = E_FAIL;
if ((!pInfo)
|| (0 == pInfo->numCpu)
|| (0 == pInfo->timerNanosec)
|| (NULL == pInfo->timerFds)
|| (NULL == pInfo->fakeTimerFds))
{
return ret;
}
m_offset = lseek(m_fd, 0, SEEK_END);
ssize_t sectionStOffset = m_offset;
// Following the structure of caperf_section_fake_timer
ssize_t rc = write(m_fd, (const void*) &pInfo->numCpu, sizeof(gtUInt32));
GT_ASSERT(rc != -1);
rc = write(m_fd, (const void*) &pInfo->timerNanosec, sizeof(gtUInt32));
GT_ASSERT(rc != -1);
rc = write(m_fd, (const void*) pInfo->timerFds, sizeof(gtUInt32) * pInfo->numCpu);
GT_ASSERT(rc != -1);
rc = write(m_fd, (const void*) pInfo->fakeTimerFds, sizeof(gtUInt32) * pInfo->numCpu);
GT_ASSERT(rc != -1);
m_offset = lseek(m_fd, 0, SEEK_CUR);
// update the section header entry
updateSectionHdr(CAPERF_SECTION_FAKE_TIMER_INFO, sectionStOffset, (m_offset - sectionStOffset));
ret = S_OK;
return ret;
}
示例5: GT_ASSERT
//设置异步
bool CCenterSocket::SetAsynchronismEngine(IUnknownEx * pIUnknownEx)
{
GT_ASSERT(pIUnknownEx!=NULL);
m_pIAsynchronismEngine=GET_OBJECTPTR_INTERFACE(pIUnknownEx,IAsynchronismEngine);
GT_ASSERT(m_pIAsynchronismEngine!=NULL);
return (m_pIAsynchronismEngine!=NULL);
}
示例6: OS_DEBUG_LOG_TRACER_WITH_RETVAL
bool GraphicsServerCommunication::GetCurrentFrameInfo(gtASCIIString& frameInfoAsXML, unsigned char*& pImageBuffer, unsigned long& imageSize)
{
bool retVal = true;
OS_DEBUG_LOG_TRACER_WITH_RETVAL(retVal);
gtASCIIString httpRtnString;
gtASCIIString commandPrefix = m_strApiHttpCommand;
retVal = SendCommandPid(commandPrefix.append("/PushLayer=FrameDebugger"), httpRtnString, "");
GT_ASSERT(retVal);
if (retVal)
{
commandPrefix = m_strApiHttpCommand;
// Send a request to get the current frame info
retVal = SendCommandPid(commandPrefix.append("/FD/GetCurrentFrameInfo.xml"), frameInfoAsXML, "");
GT_ASSERT(retVal);
if (retVal)
{
commandPrefix = m_strApiHttpCommand;
// Send a request to get the current frame thumbnail
retVal = SendCommandWithBinaryData(commandPrefix.append("/FD/GetFrameBufferImage.png?width=512?height=512"), pImageBuffer, imageSize);
if (retVal)
{
PopLayer();
}
}
}
return retVal;
}
示例7: switch
bool __cdecl CRequestSocket::OnSocketServerRequest(CMD_Command Command, void * pBuffer, WORD wDataSize)
{
switch(Command.wSubCmdID)
{
case SUB_CS_GET_LOADERSERVERINFO_SUCCESS:
{
GT_ASSERT(wDataSize >= sizeof(CMD_CS_LoaderServerInfo));
CMD_CS_LoaderServerInfo *pInfo = (CMD_CS_LoaderServerInfo*)pBuffer;
GT_ASSERT(m_pIEventService!=NULL);
TCHAR szDescribe[128]=TEXT("");
_snprintf(szDescribe,sizeof(szDescribe),TEXT("【服务ID %ld】请求登陆信息成功"),(LONG)m_pInitParamter->m_wServerID);
m_pIEventService->ShowEventNotify(szDescribe,Level_Normal);
GT_ASSERT(m_pGameServiceParameter);
memcpy(m_pGameServiceParameter, pInfo, sizeof(CMD_CS_LoaderServerInfo));
CXOREncrypt::CrevasseData(pInfo->GameUserDBInfo.szDataBasePipeName,m_pInitParamter->m_szGameUserDBPipeName,CountArray(m_pInitParamter->m_szGameUserDBPipeName));
CXOREncrypt::CrevasseData(pInfo->GameUserDBInfo.szDataBaseUser,m_pInitParamter->m_szGameUserDBUser,CountArray(m_pInitParamter->m_szGameUserDBUser));
CXOREncrypt::CrevasseData(pInfo->GameUserDBInfo.szDataBasePass,m_pInitParamter->m_szGameUserDBPass,CountArray(m_pInitParamter->m_szGameUserDBPass));
m_pInitParamter->m_wGameUserDBPort = pInfo->GameUserDBInfo.wDataBasePort;
struct in_addr in;
in.S_un.S_addr = pInfo->GameUserDBInfo.dwDataBaseAddr;
strcpy(m_pInitParamter->m_szGameUserDBAddr,inet_ntoa(in));
strcpy(m_pInitParamter->m_szGameUserDBName, szGameUserDB);
CXOREncrypt::CrevasseData(pInfo->GameScoreDBInfo.szDataBasePipeName,m_pInitParamter->m_szServerInfoDBPipeName,CountArray(m_pInitParamter->m_szServerInfoDBPipeName));
CXOREncrypt::CrevasseData(pInfo->GameScoreDBInfo.szDataBaseUser,m_pInitParamter->m_szServerInfoDBUser,CountArray(m_pInitParamter->m_szServerInfoDBUser));
CXOREncrypt::CrevasseData(pInfo->GameScoreDBInfo.szDataBasePass,m_pInitParamter->m_szServerInfoDBPass,CountArray(m_pInitParamter->m_szServerInfoDBPass));
m_pInitParamter->m_wServerInfoDBPort = pInfo->GameScoreDBInfo.wDataBasePort;
in.S_un.S_addr = pInfo->GameScoreDBInfo.dwDataBaseAddr;
strcpy(m_pInitParamter->m_szServerInfoDBAddr,inet_ntoa(in));
strcpy(m_pInitParamter->m_szServerInfoDBName, szGameUserDB);
GT_ASSERT(m_pParentContainer!=NULL);
m_pParentContainer->OnRequestInfoOk(0,0);
return true;
}
case SUB_CS_GET_LOADERSERVERINFO_FAILD:
{
GT_ASSERT(m_pIEventService!=NULL);
TCHAR szDescribe[128]=TEXT("");
_snprintf(szDescribe,sizeof(szDescribe),TEXT("【服务ID %ld】启动服务失败"),(LONG)m_pInitParamter->m_wServerID);
m_pIEventService->ShowEventNotify(szDescribe,Level_Exception);
return true;
}
default:
break;
}
return false;
}
示例8: GT_ASSERT
//请求消息
HRESULT CControlWnd::OnAsynRequest(WPARAM wParam, LPARAM lParam)
{
//效验变量
GT_ASSERT(m_pAsynchronismEngine!=NULL);
//获取参数
WORD wRequestID=(WORD)wParam;
IAsynchronismEngineSink * pIAsynchronismEngineSink=(IAsynchronismEngineSink *)lParam;
//请求处理
GT_ASSERT(pIAsynchronismEngineSink!=NULL);
m_pAsynchronismEngine->OnAsynchronismRequest(wRequestID,pIAsynchronismEngineSink);
return 0;
}
示例9: _contextId
// ---------------------------------------------------------------------------
// Name: suCallsHistoryLogger::suCallsHistoryLogger
// Description: Constructor
//
// Author: Yaki Tebeka
// Date: 5/7/2003
// ---------------------------------------------------------------------------
suCallsHistoryLogger::suCallsHistoryLogger(apContextID contextId, apMonitoredFunctionId creationFunc, unsigned int maxLoggedFunctions, const wchar_t* loggerMessagesLabelFormat, bool threadSafeLogging)
: _contextId(contextId),
m_contextCreationFunc(creationFunc),
_isLoggingEnabled(true),
_threadSafeLogging(threadSafeLogging),
_loggingCSEntered(false),
_maxLoggedFunctions(maxLoggedFunctions),
_isHTMLLogFileActive(false),
_rawMemoryLogger(INITIALE_SIZE_OF_RAW_MEMORY, threadSafeLogging),
_lastCalledFunctionId(apMonitoredFunctionsAmount),
_isInOpenGLBeginEndBlock(false),
_allocationFailureOccur(false),
_transferableObjTypeToParameter(NULL)
{
// Initialize the logger messages label:
_loggerMessagesLabel.appendFormattedString(loggerMessagesLabelFormat, contextId._contextId);
// Initialize the _transferableObjTypeToParameter vector:
bool rc = initializeTransferableObjectTypeVec();
GT_ASSERT(rc);
// Register me to receive _rawMemoryLogger memory allocation failures notifications:
_rawMemoryLogger.registerAllocationFailureObserver(this);
// Initialize the log file creation time to the current time:
_logCreationTime.setFromCurrentTime();
}
示例10: oaMessageBoxIconToOSStyle
// ---------------------------------------------------------------------------
// Name: osMessageBox::iconToOSStyle
// Description: Translated osMessageBoxIcon to OS message box style mask.
// Arguments: icon - The input icon.
// Return Val: unsigned int - The output OS style mask.
// Author: AMD Developer Tools Team
// Date: 6/10/2004
// ---------------------------------------------------------------------------
unsigned int oaMessageBoxIconToOSStyle(osMessageBox::osMessageBoxIcon icon)
{
// Translate from osDefaultOSIconType to Win32 message box styles:
unsigned int retVal = 0;
switch (icon)
{
case osMessageBox::OS_EXCLAMATION_POINT_ICON:
retVal = MB_ICONEXCLAMATION;
break;
case osMessageBox::OS_DISPLAYED_INFO_ICON:
retVal = MB_ICONINFORMATION;
break;
case osMessageBox::OS_QUESTION_MARK_ICON:
retVal = MB_ICONQUESTION;
break;
case osMessageBox::OS_STOP_SIGN_ICON:
retVal = MB_ICONSTOP;
break;
default:
// Unknown icon type:
GT_ASSERT(false);
}
return retVal;
}
示例11: osWStat
// ---------------------------------------------------------------------------
// Name: bool osFilePathByLastModifiedDateCompareFunctor::operator ()(const osFilePath& file1, const osFilePath& file2)
// Description: Compares files by the last modification date
// Arguments:
// file1, file2 - the two filePaths to compare
//Return Value:
// Returns true iff the last access date of file1 is more recent than that of file2
// Author: AMD Developer Tools Team
// Date: 2007/12/24
// ---------------------------------------------------------------------------
bool osFilePathByLastModifiedDateCompareFunctor::operator()(const osFilePath& file1, const osFilePath& file2)
{
// The struct that hold the files information
osStatStructure file1Properties, file2Properties;
// Get the filenames
gtString file1Name = file1.asString();
gtString file2Name = file2.asString();
// Get the files status
int rc1 = osWStat(file1Name, file1Properties);
int rc2 = osWStat(file2Name, file2Properties);
GT_ASSERT(rc1 == 0 && rc2 == 0);
// Extract the last modified date from the properties struct
// lastModifiedFile1Time and lastModifiedFile2Time hold the number of seconds that passed since
// January 1, 1970 until the last modification moment.
// Notice: Do not use access time, since on Vista, access time is hardly ever changed.
time_t lastModifiedFile1Time = file1Properties.st_mtime;
time_t lastModifiedFile2Time = file2Properties.st_mtime;
// If the number of seconds since January 1st, 1970 to the last access moment is bigger,
// then the last access date is newer
return (lastModifiedFile1Time > lastModifiedFile2Time);
}
开发者ID:davidlee80,项目名称:amd-gpuperfstudio-dx12,代码行数:36,代码来源:osFilePathByLastAccessDateCompareFunctor.cpp
示例12: GT_ASSERT
// ---------------------------------------------------------------------------
// Name: osNULLSocket::read
// Description: Fails and generates an assertion failure.
// Author: AMD Developer Tools Team
// Date: 25/8/2005
// ---------------------------------------------------------------------------
bool osNULLSocket::read(gtByte* pDataBuffer, gtSize_t dataSize)
{
(void)(pDataBuffer); // unused
(void)(dataSize); // unused
GT_ASSERT(false);
return false;
}
示例13: acListCtrl
gpTraceSummaryTable::gpTraceSummaryTable(gpTraceDataContainer* pDataContainer, gpTraceView* pSessionView, eCallType callType)
: acListCtrl(nullptr), m_callType(callType), m_pSessionDataContainer(pDataContainer), m_pTraceView(pSessionView), m_lastSelectedRowIndex(-1)
{
QStringList columnCaptions;
columnCaptions << GP_STR_SummaryTableColumnCall;
columnCaptions << GP_STR_SummaryTableColumnMaxTime;
columnCaptions << GP_STR_SummaryTableColumnMinTime;
columnCaptions << GP_STR_SummaryTableColumnAvgTime;
columnCaptions << GP_STR_SummaryTableColumnCumulativeTime;
columnCaptions << GP_STR_SummaryTableColumnPercentageOfTotalTime;
columnCaptions << GP_STR_SummaryTableColumnNumberOfCalls;
initHeaders(columnCaptions, false);
setShowGrid(true);
m_logic.Init(m_callType, m_pSessionDataContainer, pSessionView);
// fill Table widget
FillTable();
setSortingEnabled(true);
setSelectionMode(QAbstractItemView::SingleSelection);
setContextMenuPolicy(Qt::NoContextMenu);
// Connect to the cell entered signal
setMouseTracking(true);
bool rc = connect(this, SIGNAL(cellEntered(int, int)), this, SLOT(OnCellEntered(int, int)));
GT_ASSERT(rc);
}
示例14: memset
HRESULT CaPerfDataWriter::writeSampleEvent(CaPerfEvent& event)
{
caperf_section_evtcfg evtCfg;
const PerfEventDataList* eventDataList = event.getEventDataList();
caperf_section_sample_id_t sinfo;
evtCfg.event_config = event.getAttribute();
evtCfg.start_idx = m_sampleIdList.size();
evtCfg.number_entries = eventDataList->size();
// TODO: Set the name of the event
memset(evtCfg.name, 0, sizeof(evtCfg.name));
ssize_t rc = write(m_fd, (const void*)&evtCfg, sizeof(evtCfg));
GT_ASSERT(rc != -1);
// save the sample-id/cpu-id stuff in m_sampleIdList;
OS_OUTPUT_FORMAT_DEBUG_LOG(OS_DEBUG_LOG_DEBUG, L"writeSampleEvent - eventDataList size(%d)", eventDataList->size());
PerfEventDataList::const_iterator iter = eventDataList->begin();
for (; iter != eventDataList->end(); iter++)
{
sinfo.sample_id = iter->m_sampleId;
sinfo.cpuid = iter->m_cpu;
sinfo.misc = 0;
OS_OUTPUT_FORMAT_DEBUG_LOG(OS_DEBUG_LOG_EXTENSIVE, L"sinfo- smaple_id(0x%lx), cpuid(%d)", sinfo.sample_id, sinfo.cpuid);
m_sampleIdList.push_back(sinfo);
}
return S_OK;
}
示例15: actionIndexToCommandId
gtString SessionActions::menuPosition(int actionIndex, afActionPositionData& positionData)
{
gtString retVal;
positionData.m_actionSeparatorType = afActionPositionData::AF_SEPARATOR_NONE;
// Get the command id:
int commandId = actionIndexToCommandId(actionIndex);
switch (commandId)
{
case ID_COPY:
case ID_FIND_NEXT:
retVal = AF_STR_EditMenuString;
break;
case ID_FIND:
case ID_SELECT_ALL:
positionData.m_actionSeparatorType = afActionPositionData::AF_SEPARATOR_BEFORE_COMMAND;
retVal = AF_STR_EditMenuString;
break;
default:
GT_ASSERT(false);
break;
};
return retVal;
}