本文整理汇总了C++中ArgParser::AddMapEntries方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgParser::AddMapEntries方法的具体用法?C++ ArgParser::AddMapEntries怎么用?C++ ArgParser::AddMapEntries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgParser
的用法示例。
在下文中一共展示了ArgParser::AddMapEntries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
/**
* <summary>
* Main Program Entry Point.
* </summary>
*/
int main(int argc, const char** argv)
{
int retval = 0;
WriteHeader();
//Add all the arguments.
s_args.AddMapEntries( s_argmap);
s_s1.RegisterArgs( "s1", s_args);
s_s2.RegisterArgs( "s2", s_args);
//Parse the arguments.
retval = s_args.Parse( argc, argv);
if( retval > 0)
{
int addr = (int) s_args.GetLong( "address");
try {
addr = s_cfgDevice.Attach(addr);
printf("Attached to ASR-2300 at address = %d\n", addr);
} catch (std::runtime_error& re) {
printf("Error: %s0\n", re.what());
return -1;
}
// Dump the device information
DumpDeviceInformation();
//Initialize the stream loggers.
retval = s_s1.Init( s_args, &s_cfgDevice);
if( retval == 0)
retval = s_s2.Init( s_args, &s_cfgDevice);
//Receive the data and store to disk.
if( retval == 0)
{
s_s1.DisplayConfiguration();
s_s2.DisplayConfiguration();
s_cfgDevice.Dci0Transport().ClearReceiveQueue();
retval = ReceiveData((size_t) (s_args.GetDouble("duration")*1000.0));
}
s_s1.Terminate();
s_s2.Terminate();
s_cfgDevice.Detach();
}
else //Arguments were not right.
{
PrintUsage();
}
return retval;
}