当前位置: 首页>>代码示例>>C++>>正文


C++ Publisher::printInfo方法代码示例

本文整理汇总了C++中Publisher::printInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ Publisher::printInfo方法的具体用法?C++ Publisher::printInfo怎么用?C++ Publisher::printInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Publisher的用法示例。


在下文中一共展示了Publisher::printInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char* argv[])
{
    // default setup choices
    cout<<endl;
    Device* dev = new MPU6050("SparkFun MPU6050");
    cout<<"Default "; dev->printInfo();
	string dF = "Sweden";
    cout<<"Default Dataset: " <<dF <<endl;
    Publisher* p = new LogFile("log.txt");
    cout<<"Default "; p->printInfo();
    
    // instantiate & initialize the HMPdetector components
	Creator oneCreator(dF, dev);
    Classifier oneClassifier(dF, dev, p);
    cout<<endl <<"Initialization phase of HMPdetector: DONE" <<endl;
    
    /*
	// instantiate & initialize the PEIS component
	peiskmt_initialize(&argc, argv);
	// retrieve componentID from the component
	int componentID = peiskmt_peisid();
	printf("componentID: %d\n", componentID);

	Classifier one_classifier(dF);
	//DEBUG: one_classifier.printSetInfo();
	SensingBracelet one_sensingBracelet(dF);
	//DEBUG: one_sensingBracelet.printSetStatus();
    */

    // available options (short-form)
	//const char *short_options = "v:r:wbBctl:mh";
    const char *short_options = "v:::mhE";
	// available options (long-form)
	static struct option long_options[] = 
	{
		{"validate", required_argument, 0, 'v'},
		//{"reason", required_argument, 0, 'r'},
		//{"wearable", required_argument, 0, 'w'},
		//{"Bracelet", required_argument, 0, 'B'},
		//{"classify", required_argument, 0, 'c'},
		//{"test", required_argument, 0, 't'},
		//{"load", required_argument, 0, 'l'},
		{"model", optional_argument, 0, 'm'},
		{"help", no_argument, 0, 'h'},
        {"EXIT", no_argument, 0, 'E'},
		{0, 0, 0, 0} //required line
	};

	// retrieve & execute the chosen option
    //!\todo make it possible to have multiple iterations
	char c;
	do 
	{
		c = getopt_long(argc, argv, short_options, long_options, NULL);
		switch (c)
		{
            case 'E':
                return EXIT_SUCCESS;
			case 'h':
				print_help();
				break;
			case 'm':
				if(argv[2])
                {
                    cout<<"Modelling folder: " <<argv[2] <<endl;
                    oneCreator.driver->printInfo();
					oneCreator.setDatasetFolder(argv[2]);
                }             				
				oneCreator.generateAllModels();
				cout<<"Created dataset in: "<<oneCreator.datasetFolder <<endl;
				break;
            /*    
			case 'l':			
				oneClassifier.buildSet(argv[2], argv[3], argv[4]);
				cout<<"Loaded dataset from: "<<oneClassifier.datasetFolder <<endl;
				break;
            */
			case 'v':
				oneClassifier.validateModel(argv[2], argv[3], atoi(argv[4]));
				cout<<"results in: ./Results/" <<argv[3] <<"/" <<endl;
				break;
            /*
			case 't':
				one_classifier.longTest(argv[2]);
				cout<<"results in: ./Results/longTest/" <<endl;
				return EXIT_SUCCESS;
				break;
			case 'c':
				cout<<"use 'tupleview' to monitor the system" <<endl;
				one_classifier.onlineTest(argv[2]);
				return EXIT_SUCCESS;
				break;
			case 'r':
				one_sensingBracelet.offlineSensingBracelet(argv[2], argv[3]);
				cout<<"results in: " <<argv[2] <<endl;
				return EXIT_SUCCESS;
				break;
			case 'B':
				cout<<"use 'tupleview' to monitor the system" <<endl;
				one_sensingBracelet.onlineSensingBracelet(argv[2]);
//.........这里部分代码省略.........
开发者ID:bbbruno,项目名称:HMPdetector,代码行数:101,代码来源:HMPdetector.cpp


注:本文中的Publisher::printInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。