这篇教程C++ stop函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中stop函数的典型用法代码示例。如果您正苦于以下问题:C++ stop函数的具体用法?C++ stop怎么用?C++ stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了stop函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: stopSFTWorker::~SFTWorker(){ stop(); safe_delete(m_pBzs);}
开发者ID:Alasaad,项目名称:Desurium,代码行数:5,
示例2: soft_stop void soft_stop () { if (state () == async_state::running) stop (); }
开发者ID:arximboldi,项目名称:psychosynth,代码行数:5,
示例3: stop /** * @brief Destroys the Timer * @details Makes sure to stop any eventual underlying Timer * if its running. */ ~Timer() { stop(); }
开发者ID:tanisman,项目名称:IncludeOS,代码行数:7,
示例4: stopConsoleProcess::~ConsoleProcess(){ stop(); delete d;}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:5,
示例5: respondStop/** * respondStop * * Default responder function. Stop the robot. */ void respondStop(void){ stop(); usleep(30);}
开发者ID:crenshaw,项目名称:upbot,代码行数:10,
示例6: mainint main(int argc, char *argv[]){ if (argc < 4) { fprintf(stderr, "usage:/t%s <D size > <Q size> <I size> " "<seed>/n", argv[0]); return 1; } int d = atoi(argv[1]); // size of data set D int q = atoi(argv[2]); // size of query set Q int i = atoi(argv[3]); // size of index I int seed = atoi(argv[4]); srand(seed); int *D = (int *) malloc(d * sizeof(int)); int j; for (j = 0; j < d; j++) D[j] = rand(); qsort(D, d, sizeof(int), compare_int); /* Print list for (j = 0; j < d; j++) printf("%d %d/n", j, D[j]); */ int *I = (int *) malloc(i * sizeof(int)); for (j = 1; j < i; j++) { int lo = -1, hi = d; I[ j - 1 ] = D[ ( j*hi + (i - j)*lo ) / i]; } unsigned long bs = 0; unsigned long is = 0; int w = 0; /* Search list */ for (j = 0; j < q; j++) { /* printf("%d/t", r); int a = b_search(r, D, d, -1, d); int b = b_search(r, I, i, -1, i); int lo = -1, hi = d; int new_hi = ( (b+1)*hi + (i - (b+1))*lo ) / i; int new_lo = ( (b)*hi + (i - (b+1))*lo ) / i; if (b == 0) new_lo = -1; else if (b == i) { new_hi = d; new_lo = ( (b-1)*hi + (i - (b+1))*lo ) / i; } int c = b_search(r, D, d, new_lo, new_hi); printf("d:%d/ti:%d/t%d/n",a,b,c); */ printf("b:/n"); int r = rand(); start(); int a = b_search(r, D, d, -1, d); stop(); bs += report(); printf("i:/n"); start(); int b = i_b_search(r, D, d, I, i); stop(); is += report(); if (a != b) ++w; } printf("%lu/t%lu/t%f/n", bs, is, (((double)bs) / ((double)is)) ); return 0;}
开发者ID:ryanlayer,项目名称:sandbox,代码行数:84,
示例7: stopConnector::~Connector (void){ this->reactor (0); stop ();}
开发者ID:helixum,项目名称:wow-cata,代码行数:5,
示例8: mainint main( void ) { if ( !init() ) { return EXIT_FAILURE; } STATE state = S_init; STATE last_state; stop(); while ( 1 ) { last_state = state; readRegisters(); switch ( state ) { default: case S_init: if ( regs.STATUS1.bumperLeft ) { state = bumperLeft; } else if ( regs.STATUS1.bumperRight ) { state = bumperRight; } else if ( regs.STATUS1.obstacleLeft ) { state = obstacleLeft; } else if ( regs.STATUS1.obstacleRight ) { state = obstacleRight; } else { state = forward; } break; case forward: if ( regs.STATUS1.bumperLeft ) { state = bumperLeft; } else if ( regs.STATUS1.bumperRight ) { state = bumperRight; } else if ( regs.STATUS1.obstacleLeft ) { state = obstacleLeft; } else if ( regs.STATUS1.obstacleRight ) { state = obstacleRight; } break; case bumperLeft: if ( regs.STATUS3.movementComplete ) { state = bumperLeft2; } break; case bumperLeft2: if ( regs.STATUS3.movementComplete ) { state = forward; } break; case bumperRight: if ( regs.STATUS3.movementComplete ) { state = bumperRight2; } break; case bumperRight2: if ( regs.STATUS3.movementComplete ) { state = forward; } break; case obstacleLeft: if ( regs.STATUS1.bumperLeft ) { state = bumperLeft; } else if ( regs.STATUS1.bumperRight ) { state = bumperRight; } else if ( !regs.STATUS1.obstacleLeft ) { state = forward; } break; case obstacleRight: if ( regs.STATUS1.bumperLeft ) { state = bumperLeft; } else if ( regs.STATUS1.bumperRight ) { state = bumperRight; } else if ( !regs.STATUS1.obstacleRight ) { state = forward; } break; } if ( last_state != state ) { switch ( state ) { case forward: stop(); changeDirection( RP6_FORWARD ); moveAtSpeed( 80 , 80 ); printf( "Change State: forward/n" ); break; case bumperLeft: stop(); move( 20 , RP6_BACKWARD , 600 ); printf( "Change State: bumperLeft/n" ); break; case bumperLeft2: rotate( 20 , RP6_RIGHT , 45 ); printf( "Change State: bumperLeft2/n" ); break; case bumperRight: stop(); move( 20 , RP6_BACKWARD , 600 );//.........这里部分代码省略.........
开发者ID:christiankarsch,项目名称:RP6-I2C-Demo,代码行数:101,
示例9: main//.........这里部分代码省略......... cv::Mat imgMat(rgbFrame->rows, rgbFrame->cols, CV_8UC4, cv::Scalar::all(0.0)); cv::cvtColor(*rgbFrame, imgMat, CV_BGR2RGBA, 4); cv::Size size(rgbFrame->cols*0.2, rgbFrame->rows*0.2); cv::resize(imgMat, imgMat, size); std::string imgDataB64 = tobase64(imgMat.data, imgMat.total()*4*sizeof(byte)); rapidjson::Value val; val.SetString(imgDataB64.c_str(), doc.GetAllocator()); doc.AddMember("data", val, aloc); doc.AddMember("type", "rgb_data", aloc); doc.AddMember("yaw", -pos[0], aloc); doc.AddMember("pitch", -pos[1], aloc); doc.AddMember("dataWidth", imgMat.cols, aloc); doc.AddMember("dataHeight", imgMat.rows, aloc); doc.AddMember("yawSize", 63.625, aloc); doc.AddMember("pitchSize", 35.789, aloc); ns->sendWSDoc(doc); } /*if(sc->popGyroReading(gyroReading)) { printf("Roll: %f, Pitch: %f, Yaw: %f./n", gyroReading.roll, gyroReading.pitch, gyroReading.yaw ); }*/ sc->requestThermoReading(); std::cout << "tick: " << timer.expires_at() << std::endl; if(showThermal && sc->popThermoReading(thermoReading)){ rapidjson::Document doc; auto &aloc = doc.GetAllocator(); doc.SetObject(); doc.AddMember("type", "thermo_data", aloc); doc.AddMember("yaw", -pos[0], aloc); doc.AddMember("pitch", -pos[1], aloc); cv::Mat imgMat(4, 16, CV_8UC4, cv::Scalar::all(0.0)); cv::Mat mat = thermoReading.img; for(int i = 0; i < mat.total(); i++) { int y = 3-(i%4); int x = i/4; double temp = mat.at<float>(0, i); if( (x == 11 && y == 2) || (x == 11 && y == 3) || (x == 12 && y == 2) ) { temp += 10.0; } //std::cout << (int)temp << " "; cv::Vec4b col = hsv( 300-300.0*(std::max(temp, 14.0)-14.0)/(40.0-14.0), 1, 1 ); if(temp <= 11.0) { col = cv::Vec4b(30, 30, 50, 255); } else if(temp > 40.0) { col = cv::Vec4b(255, 255, 255, 255); } imgMat.at<cv::Vec4b>(y, x) = col; //std::cout << std::endl; } std::string imgDataB64 = tobase64(imgMat.data, imgMat.total()*4*sizeof(byte)); rapidjson::Value val; val.SetString(imgDataB64.c_str(), doc.GetAllocator()); doc.AddMember("data", val, aloc); ns->sendWSDoc(doc); } timer.expires_from_now(boost::posix_time::milliseconds(interval)); timer.async_wait(captureStuff); }; timer.expires_from_now(boost::posix_time::milliseconds(interval)); timer.async_wait(captureStuff); ns->registerCallback("move_actuator", [&](const rapidjson::Document &doc) { ac->stop(); ActuatorMoveOrder order; order.posDeg = cv::Vec2d( std::max(-150.0, std::min(150.0, -doc["yaw" ].GetDouble()/M_PI*180)), std::max(- 90.0, std::min( 90.0, -doc["pitch"].GetDouble()/M_PI*180)) ); order.duration = 3.5; ac->queueMove(order); }); std::cout << "run" << std::endl; core->run();}
开发者ID:Chris112,项目名称:sep,代码行数:101,
示例10: stopuint8_t I2C::endTransmission(){ stop(); return(returnStatusWire);}
开发者ID:AhLeeYong,项目名称:x-drone,代码行数:5,
示例11: stopOpenALSoundSource::~OpenALSoundSource(){ stop(); alDeleteSources(1, &source);}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:5,
示例12: my_invoker//The main invoker routine. It takes as argument the next command to execute and does what is necessary//Self-explanatory code!void my_invoker (unsigned char command) { if(command == BUZZER_ON){ buzzer_on(); return; } else if(command == BUZZER_OFF){ buzzer_off(); return; } else if(command == MOVE_FORWARD) { forward(); //forward return; } else if(command == MOVE_BACKWARD) { back(); //back return; } else if(command == MOVE_LEFT) { left(); //left return; } else if(command == MOVE_RIGHT) { right(); //right return; } else if(command == STOP) { stop(); //stop return; } else if(command == SET_VELOCITY) { int numargs; unsigned char * ch = recieve_args(&numargs); //assert(numargs == 1); int velleft = (int)*(ch); int velright = (int)*(ch+1); velocity(velleft,velright); return; } else if(command == MOVE_BY) { int numargs; unsigned char * ch = recieve_args(&numargs); int pos_a = (int)*(ch); int pos_b = (int)*(ch+1); //int pos = 10; //while (pos_b--) pos *= 10; //pos *= pos_a; //forward_mm(pos); pos_a += (pos_b << 8); forward(); velocity(120,120); while (pos_a--) { //delay on 5 ms stop_on_timer4_overflow = 1; start_timer4(); while (stop_on_timer4_overflow != 0) {;} } stop(); send_char(SUCCESS); leftInt = 0; rightInt = 0; return; } else if(command == MOVE_BACK_BY) { int numargs; unsigned char * ch = recieve_args(&numargs); int pos_a = (int)*(ch); int pos_b = (int)*(ch+1); //int pos = 10; //while (pos_b--) pos *= 10; //pos *= pos_a; //forward_mm(pos); pos_a += (pos_b << 8); back(); velocity(120,120);//.........这里部分代码省略.........
开发者ID:eyantra,项目名称:CS308_Android-Interface---Firebird-API_2012,代码行数:101,
示例13: stop io_looper::~io_looper(void) { stop(); }
开发者ID:jango2015,项目名称:rDSN,代码行数:4,
|