本文整理汇总了C++中ConfigurationTable::getTeX方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigurationTable::getTeX方法的具体用法?C++ ConfigurationTable::getTeX怎么用?C++ ConfigurationTable::getTeX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigurationTable
的用法示例。
在下文中一共展示了ConfigurationTable::getTeX方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: time
int
main(int argc, char **argv)
{
// TODO: Properly parse and handle any arguments
if (argc > 1) {
for (int argi = 0; argi < argc; argi++) {
if (!strcmp(argv[argi], "--version") ||
!strcmp(argv[argi], "-v")) {
cout << gVersionString << endl;
}
if (!strcmp(argv[argi], "--gensql")) {
cout << gConfig.getDefaultSQL(string(argv[0]), gVersionString) << endl;
}
if (!strcmp(argv[argi], "--gentex")) {
cout << gConfig.getTeX(string(argv[0]), gVersionString) << endl;
}
}
return 0;
}
sockaddr_in si_me;
sockaddr_in si_other;
int aSocket;
char buf[BUFLEN];
LOG(ALERT) << argv[0] << " (re)starting";
srand ( time(NULL) + (int)getpid() );
my_udp_port = gConfig.getNum("SubscriberRegistry.Port");
gSubscriberRegistry.init();
gNodeManager.setAppLogicHandler(&nmHandler);
gNodeManager.start(45064);
// init osip lib
osip_t *osip;
int i=osip_init(&osip);
if (i!=0) {
LOG(ALERT) << "cannot init sip lib";
exit(1);
}
if ((aSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
LOG(ALERT) << "can't initialize socket";
exit(1);
}
memset((char *) &si_me, 0, sizeof(si_me));
si_me.sin_family = AF_INET;
si_me.sin_port = htons(my_udp_port);
si_me.sin_addr.s_addr = htonl(INADDR_ANY);
if (bind(aSocket, (sockaddr*)&si_me, sizeof(si_me)) == -1) {
LOG(ALERT) << "can't bind socket on port " << my_udp_port;
exit(1);
}
LOG(NOTICE) << "binding on port " << my_udp_port;
while (true) {
gConfig.purge();
socklen_t slen = sizeof(si_other);
memset(buf, 0, BUFLEN);
if (recvfrom(aSocket, buf, BUFLEN, 0, (sockaddr*)&si_other, &slen) == -1) {
LOG(ERR) << "recvfrom problem";
continue;
}
LOG(INFO) << " receiving " << buf;
char *dest = processBuffer(buf);
if (dest == NULL) {
continue;
}
if (sendto(aSocket, dest, strlen(dest), 0, (sockaddr*)&si_other, sizeof(si_other)) == -1) {
LOG(ERR) << "sendto problem";
continue;
}
osip_free(dest);
}
close(aSocket);
return 0;
}
示例2: 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 {
//.........这里部分代码省略.........