本文整理汇总了C++中Configure::args方法的典型用法代码示例。如果您正苦于以下问题:C++ Configure::args方法的具体用法?C++ Configure::args怎么用?C++ Configure::args使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configure
的用法示例。
在下文中一共展示了Configure::args方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
cfg.path("../../setup");
cfg.args("detector.webcam.provider.", argv);
if (argc == 1) cfg.load("config.csv");
bool verbose = cfg.flag("detector.webcam.provider.verbose", true);
if (verbose) cfg.show();
int indexR = (int)cfg.num("detector.webcam.provider.indexR");
int indexL = (int)cfg.num("detector.webcam.provider.indexL");
int sleep_time = (int)cfg.num("detector.webcam.provider.sleep_time");
std::string addressf = cfg.str("detector.webcam.provider.f_ip").c_str();
std::string addressc = cfg.str("detector.webcam.provider.c_ip").c_str();
std::string port = cfg.str("detector.webcam.provider.port").c_str();
signal(SIGINT, quitproc);
signal(SIGTERM, quitproc);
signal(SIGQUIT, quitproc);
webcamProvider p(indexR, indexL, sleep_time, verbose, argv[0], addressf.c_str(), addressc.c_str(), port);
ghost = &p;
if(p.init()) {
//p.rotate();
p.provide();
}
return 0;
}
示例2: main
int main(int argc, char *argv[])
{
cfg.path("../../setup");
cfg.args("proxyservos.",argv);
if (argc == 1) cfg.load("config.csv");
cfg.servos();
verbose = cfg.flag("proxyservos.verbose",false);
if (verbose) cfg.show();
server = ProxyServoListenerSP(new ProxyServoListener());
signal(SIGINT, quit);
signal(SIGTERM, quit);
signal(SIGQUIT, quit);
while (server) {
usleep(int(0.25*1e6));
}
std::cout << "done" << std::endl;
return 0;
}
示例3: main
int main(int argc, char** argv)
{
pid_t leapd_pid;
if ((leapd_pid=fork()) == 0) {
execl("/usr/bin/leapd","leapd",0);
}
cfg.path("../../setup");
cfg.args("leap.provider.", argv);
if (argc == 1) cfg.load("config.csv");
verbose = cfg.flag("leap.provider.verbose", false);
if (verbose) cfg.show();
decay_time = cfg.num("leap.provider.decay_time");
int hwm = 1;
int retries = 5;
int linger = 25;
int rc = 0;
bool connected = false;
MyListener listener;
Controller controller(listener);
zmq_context = zmq_ctx_new ();
zmq_pub = zmq_socket(zmq_context,ZMQ_PUB);
while(!connected && retries--) {
if(zmq_setsockopt(zmq_pub, ZMQ_SNDHWM, &hwm, sizeof(hwm)) == 0) {
if(zmq_setsockopt(zmq_pub, ZMQ_LINGER, &linger, sizeof(linger)) == 0) {
if(zmq_bind(zmq_pub, cfg.str("leap.provider.publish").c_str()) == 0) {
connected = true;
}
}
}
if (retries <= 0) {
int en=zmq_errno();
std::cout << "TCP Error Number " << en << " " << zmq_strerror(en) << std::endl;
die = true;
}
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}
signal(SIGINT, quitproc);
signal(SIGTERM, quitproc);
signal(SIGQUIT, quitproc);
while(!die) {
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
controller.removeListener(listener);
zmq_close(zmq_pub);
zmq_ctx_destroy(zmq_context);
kill(leapd_pid,SIGINT);
waitpid(leapd_pid,0,0);
std::cout << "--done!" << std::endl;
return 0;
}