本文整理汇总了C++中ConfigurationTable::setCrossCheckHook方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigurationTable::setCrossCheckHook方法的具体用法?C++ ConfigurationTable::setCrossCheckHook怎么用?C++ ConfigurationTable::setCrossCheckHook使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigurationTable
的用法示例。
在下文中一共展示了ConfigurationTable::setCrossCheckHook方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
//mtrace(); // (pat) Enable memory leak detection. Unfortunately, huge amounts of code have been started in the constructors above.
gLogGroup.setAll();
// TODO: Properly parse and handle any arguments
if (argc > 1) {
bool testflag = false;
for (int argi = 1; argi < argc; argi++) { // Skip argv[0] which is the program name.
if (!strcmp(argv[argi], "--version") || !strcmp(argv[argi], "-v")) {
// Print the version number and exit immediately.
cout << gVersionString << endl;
return 0;
}
if (!strcmp(argv[argi], "--test")) {
testflag = true;
continue;
}
if (!strcmp(argv[argi], "--gensql")) {
cout << gConfig.getDefaultSQL(string(argv[0]), gVersionString) << endl;
return 0;
}
if (!strcmp(argv[argi], "--gentex")) {
cout << gConfig.getTeX(string(argv[0]), gVersionString) << endl;
return 0;
}
// (pat) Adding support for specified sql file.
// Unfortunately, the Config table was inited quite some time ago,
// so stick this arg in the environment, whence the ConfigurationTable can find it, and then reboot.
if (!strcmp(argv[argi],"--config")) {
if (++argi == argc) {
LOG(ALERT) <<"Missing argument to --config option";
exit(2);
}
setenv(cOpenBTSConfigEnv,argv[argi],1);
execl(argv[0],"OpenBTS",NULL);
LOG(ALERT) <<"execl failed? Exiting...";
exit(0);
}
if (!strcmp(argv[argi],"--help")) {
printf("OpenBTS [--version --gensql --gentex] [--config file.db]\n");
printf("OpenBTS exiting...\n");
exit(0);
}
printf("OpenBTS: unrecognized argument: %s\nexiting...\n",argv[argi]);
}
if (testflag) { GSM::TestTCHL1FEC(); return 0; }
}
createStats();
gConfig.setCrossCheckHook(&configurationCrossCheck);
gReports.incr("OpenBTS.Starts");
gNeighborTable.NeighborTableInit(
gConfig.getStr("Peering.NeighborTable.Path").c_str());
int sock = socket(AF_UNIX,SOCK_DGRAM,0);
if (sock<0) {
perror("creating CLI datagram socket");
LOG(ALERT) << "cannot create socket for CLI";
gReports.incr("OpenBTS.Exit.CLI.Socket");
exit(1);
}
try {
srandom(time(NULL));
gConfig.setUpdateHook(purgeConfig);
LOG(ALERT) << "OpenBTS (re)starting, ver " << VERSION << " build date " << __DATE__;
LOG(ALERT) << "OpenBTS reading config file "<<cOpenBTSConfigFile;
COUT("\n\n" << gOpenBTSWelcome << "\n");
Control::controlInit(); // init Layer3: TMSITable, TransactionTable.
gPhysStatus.open(gConfig.getStr("Control.Reporting.PhysStatusTable").c_str());
gBTS.init();
gParser.addCommands();
COUT("\nStarting the system...");
// is the radio running?
// Start the transceiver interface.
LOG(INFO) << "checking transceiver";
//gTRX.ARFCN(0)->powerOn();
//sleep(gConfig.getNum("TRX.Timeout.Start"));
//bool haveTRX = gTRX.ARFCN(0)->powerOn(false); This prints an inapplicable warning message.
bool haveTRX = gTRX.ARFCN(0)->trxRunning(); // This does not print an inapplicable warning message.
Thread transceiverThread;
if (!haveTRX) {
LOG(ALERT) << "starting the transceiver";
transceiverThread.start((void*(*)(void*)) startTransceiver, NULL);
// sleep to let the FPGA code load
// TODO: we should be "pinging" the radio instead of sleeping
sleep(5);
} else {
//.........这里部分代码省略.........