本文整理汇总了C++中Profile::GetResultsFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ Profile::GetResultsFormat方法的具体用法?C++ Profile::GetResultsFormat怎么用?C++ Profile::GetResultsFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::GetResultsFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int __cdecl main(int argc, const char* argv[])
{
//
// parse cmd line parameters
//
struct Synchronization synch; //sychronization structure
synch.ulStructSize = sizeof(synch);
synch.hStopEvent = NULL;
synch.hStartEvent = NULL;
CmdLineParser cmdLineParser;
Profile profile;
if (!cmdLineParser.ParseCmdLine(argc, argv, &profile, &synch))
{
return ERROR_PARSE_CMD_LINE;
}
synch.pfnCallbackTestStarted = TestStarted;
synch.pfnCallbackTestFinished = TestFinished;
//
// create abort event if stop event is not explicitly provided by the user (otherwise use the stop event)
//
if (NULL == synch.hStopEvent)
{
synch.hStopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if( NULL == synch.hStopEvent )
{
fprintf(stderr, "Unable to create an abort event for CTRL+C\n");
//FUTURE EXTENSION: change error code
return 1;
}
}
g_hAbortEvent = synch.hStopEvent; // set abort event to either stop event provided by user or the just created event
//
// capture ctrl+c
//
if( !SetConsoleCtrlHandler(ctrlCRoutine, TRUE) )
{
fprintf(stderr, "Unable to set CTRL+C routine\n");
//FUTURE EXTENSION: change error code
return 1;
}
//
// call IO request generator
//
ResultParser resultParser;
XmlResultParser xmlResultParser;
IResultParser *pResultParser = nullptr;
if (profile.GetResultsFormat() == ResultsFormat::Xml)
{
pResultParser = &xmlResultParser;
}
else
{
pResultParser = &resultParser;
}
IORequestGenerator ioGenerator;
if (!ioGenerator.GenerateRequests(profile, *pResultParser, (PRINTF)PrintOut, (PRINTF)PrintError, (PRINTF)PrintOut, &synch))
{
fprintf(stderr, "Error generating I/O requests\n");
return 1;
}
if( NULL != synch.hStartEvent )
{
CloseHandle(synch.hStartEvent);
}
if( NULL != synch.hStopEvent )
{
CloseHandle(synch.hStopEvent);
}
if( g_hEventStarted )
{
CloseHandle(g_hEventStarted);
}
if( NULL != g_hEventFinished )
{
CloseHandle(g_hEventFinished);
}
return 0;
}