这篇教程C++ DS函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DS函数的典型用法代码示例。如果您正苦于以下问题:C++ DS函数的具体用法?C++ DS怎么用?C++ DS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DS函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: connectvoid SettingsWindow::connectSlots(){ connect (m_ok, SIGNAL (clicked()), this, SLOT (apply())); connect (m_reset, SIGNAL (clicked()), this, SLOT (reset())); connect (m_cancel, SIGNAL (clicked()), this, SLOT (cancel())); connect (DS(), SIGNAL (teamChanged (int)), this, SLOT (updateTeam (int))); connect (DS(), SIGNAL (protocolChanged()), this, SLOT (readSettings())); connect (m_useCustomAddress, SIGNAL (toggled (bool)), m_robotAddress, SLOT (setEnabled (bool))); connect (m_baseButton, SIGNAL (clicked()), this, SLOT (onSelectorClicked())); connect (m_highlightButton, SIGNAL (clicked()), this, SLOT (onSelectorClicked())); connect (m_backgroundButton, SIGNAL (clicked()), this, SLOT (onSelectorClicked())); connect (m_foregroundButton, SIGNAL (clicked()), this, SLOT (onSelectorClicked())); connect (m_baseEdit, SIGNAL (textChanged (QString)), this, SLOT (onColorChanged (QString))); connect (m_highlightEdit, SIGNAL (textChanged (QString)), this, SLOT (onColorChanged (QString))); connect (m_backgroundEdit, SIGNAL (textChanged (QString)), this, SLOT (onColorChanged (QString))); connect (m_foregroundEdit, SIGNAL (textChanged (QString)), this, SLOT (onColorChanged (QString)));}
开发者ID:PeterMitrano,项目名称:QDriverStation,代码行数:27,
示例2: DSvoid SettingsWindow::applySettings(){ /* Set the team number to be sure the address placeholder is good */ DS()->setTeamNumber (Settings::get ("Team", 0).toInt()); /* Only use a custom robot address if the checkbox is checked */ QString ip = m_useCustomAddress->isChecked() ? m_robotAddress->text() : ""; Settings::set ("Robot Address", ip); /* Apply the robot address */ DS()->setRobotAddress (ip); m_robotAddress->setText (ip); m_robotAddress->setPlaceholderText (DS()->defaultRobotAddress()); /* Apply other settings */ Settings::set ("Auto Updater", m_autoUpdater->isChecked()); Settings::set ("UI Sounds", m_soundEffects->isChecked()); Settings::set ("Prompt on Quit", m_promptOnQuit->isChecked()); /* Create and apply a theme from UI values */ AppTheme::Theme theme; theme.base = m_baseEdit->text(); theme.highlight = m_highlightEdit->text(); theme.background = m_backgroundEdit->text(); theme.foreground = m_foregroundEdit->text(); AppTheme::apply (theme);}
开发者ID:PeterMitrano,项目名称:QDriverStation,代码行数:27,
示例3: FileXferDoneBOOL CTwain::FileXfer(void){ TW_SETUPFILEXFER twsfx; if (!DS(DG_CONTROL, DAT_SETUPFILEXFER, MSG_GET, &twsfx)) { return FALSE; } int nFF = twsfx.Format; if (!FileXferReady(nFF, twsfx.FileName)) { // application aborted transfer return FALSE; } twsfx.Format = (TW_UINT16)nFF; if (!DS(DG_CONTROL, DAT_SETUPFILEXFER, MSG_SET, &twsfx)) { FileXferDone(NULL, 0); return FALSE; } if (!DS(DG_IMAGE, DAT_IMAGEFILEXFER, MSG_GET, NULL)) { FileXferDone(NULL, 0); return FALSE; } ATLASSERT(nState >= TRANSFER_READY); EndXfer(); // acknowledge & end transfer ATLASSERT(nState == TRANSFER_READY || nState == SOURCE_ENABLED); FlushMessageQueue(); FileXferDone(twsfx.FileName, 255); return TRUE;}
开发者ID:ZacWalk,项目名称:ImageWalker,代码行数:29,
示例4: buttons_waitingstatic QState buttons_waiting(struct Buttons *me){ switch (Q_SIG(me)) { case Q_ENTRY_SIG: SERIALSTR("<+bw>"); DS(button1, BUTTON_RELEASED_SIGNAL); DS(button2, BUTTON_RELEASED_SIGNAL); DS(button3, BUTTON_RELEASED_SIGNAL); me->up_counter = 3; return Q_HANDLED(); case BUTTONS_SIGNAL: if ((uint16_t)(Q_PAR(me)) == 0) { me->up_counter --; if (me->up_counter) { return Q_HANDLED(); } else { SERIALSTR("@"); return Q_TRAN(buttons_state); } } else { me->up_counter = 3; return Q_HANDLED(); } case Q_EXIT_SIG: SERIALSTR("<-bw>"); return Q_HANDLED(); } return Q_SUPER(buttons_state);}
开发者ID:russells,项目名称:hc2,代码行数:29,
示例5: ATLASSERTBOOL CTwain::MemoryXfer(void){ ATLASSERT(nState == TRANSFER_READY); TW_IMAGEINFO info; TW_SETUPMEMXFER twsx; TW_IMAGEMEMXFER mx; if (!DS(DG_CONTROL, DAT_SETUPMEMXFER, MSG_GET, &twsx)) { return FALSE; } // Get actual image info if (!DS(DG_IMAGE, DAT_IMAGEINFO, MSG_GET, &info)) { return FALSE; } ATLASSERT(nState == TRANSFER_READY); if (!MemXferReady(info)) { // application aborted transfer return FALSE; } if (!MemXferAlloc(twsx, mx.Memory)) { MemXferDone(FALSE); return FALSE; } int iRow = 0; while (DS(DG_IMAGE, DAT_IMAGEMEMXFER, MSG_GET, &mx)) { // We got a buffer - make sure DS doesn't // feed us rows past the end of the image: mx.Rows = min(mx.Rows, (unsigned)(info.ImageLength - iRow)); // Don't call the buffer-handler with 0 rows if (mx.Rows != 0) { if (!MemXferBuffer(iRow, mx)) { // Buffer callback says to abort break; } iRow += mx.Rows; } if (ResultCode() == TWRC_XFERDONE) { // DS says that was the last buffer: iRow = info.ImageLength; // no matter what, we're done break; } } MemXferFree(mx.Memory); ATLASSERT(nState >= TRANSFER_READY); EndXfer(); // acknowledge & end transfer ATLASSERT(nState == TRANSFER_READY || nState == SOURCE_ENABLED); FlushMessageQueue(); MemXferDone(iRow == info.ImageLength); return TRUE;}
开发者ID:ZacWalk,项目名称:ImageWalker,代码行数:57,
示例6: sql_change_passwd/* change passwd */int sql_change_passwd(cs_request_t *req, sqlite3 *db, buf_t *wbuf){ if (req == NULL || req->name == NULL || req->passwd == NULL || db == NULL || wbuf == NULL || wbuf->data == NULL) { E("parameter error."); return -1; } char *query_line = (char *)cs_malloc(sizeof(char) * QUERY_LEN_MAX); if (query_line == NULL) { E("cs_malloc() failed."); DPSTR(wbuf); return -1; } /* check identify */ sprintf(query_line, "select * from users where name='%s' and passwd='%s'", req->name, req->passwd); DS(query_line); int sql_select_num = 0; int ret = sqlite3_exec(db, query_line, sql_check_identity_cb, &sql_select_num, NULL); if (ret != SQLITE_OK || sql_select_num != 1) { /* no this user & passwd */ E("sqlite3_exec() failed."); DD(sql_select_num); cs_free(&query_line); strncpy(wbuf->data, "err", 3); wbuf->len = 3; return -1; } /* update user info in users table */ memset(query_line, '/0', QUERY_LEN_MAX); sprintf(query_line, "update users set passwd='%s' where name='%s'", req->content, req->name); DS(query_line); ret = sqlite3_exec(db, query_line, NULL, NULL, NULL); if (ret != SQLITE_OK) { E("sqlite3_exec() failed."); cs_free(&query_line); strncpy(wbuf->data, "err", 3); wbuf->len = 3; return -1; } strncpy(wbuf->data, "ok", 2); wbuf->len = 2; cs_free(&query_line); D(GREEN"user %s change passwd success.", req->name); return 0;}
开发者ID:jesse2013,项目名称:cs,代码行数:58,
示例7: sql_del_log/* del log */int sql_del_log(cs_request_t *req, sqlite3 *db, buf_t *wbuf){ if (req == NULL || req->name == NULL || req->buddy_name == NULL || db == NULL || wbuf == NULL || wbuf->data == NULL) { E("parameter error."); return -1; } char *query_line = (char *)cs_malloc(sizeof(char) * QUERY_LEN_MAX); if (query_line == NULL) { E("cs_malloc() failed."); DPSTR(wbuf); return -1; } /* check log_type */ sprintf(query_line, "select * from %s where name='%s'", req->name, req->buddy_name); DS(query_line); int log_type = -1; int ret = sqlite3_exec(db, query_line, sql_log_type_cb, &log_type, NULL); if (ret != SQLITE_OK) { E("sqlite3_exec() failed."); DD(log_type); cs_free(&query_line); return -1; } /* empty offline table message */ memset(query_line, '/0', QUERY_LEN_MAX); if (log_type == 0) sprintf(query_line, "delete from %s_%s", req->name, req->buddy_name); else if (log_type == 1) sprintf(query_line, "delete from %s_%s", req->buddy_name, req->name); else DD(log_type); DS(query_line); ret = sqlite3_exec(db, query_line, NULL, NULL, NULL); if (ret != SQLITE_OK) { E("sqlite3_exec() failed."); cs_free(&query_line); return -1; } strncpy(wbuf->data, "ok", 2); wbuf->len = 2; cs_free(&query_line); D(GREEN"clear log with %s success.", req->buddy_name); return 0;}
开发者ID:jesse2013,项目名称:cs,代码行数:54,
示例8: buttons_statestatic QState buttons_state(struct Buttons *me){ switch (Q_SIG(me)) { case Q_ENTRY_SIG: SERIALSTR("(b2)"); return Q_HANDLED(); case BUTTONS_WAIT_SIGNAL: return Q_TRAN(buttons_waiting); case BUTTONS_SIGNAL: if ((uint16_t)(Q_PAR(me)) & 0b0001) { DS(button1, BUTTON_PRESSED_SIGNAL); } else { DS(button1, BUTTON_RELEASED_SIGNAL); } if ((uint16_t)(Q_PAR(me)) & 0b0010) { DS(button2, BUTTON_PRESSED_SIGNAL); } else { DS(button2, BUTTON_RELEASED_SIGNAL); } if ((uint16_t)(Q_PAR(me)) & 0b0100) { DS(button3, BUTTON_PRESSED_SIGNAL); } else { DS(button3, BUTTON_RELEASED_SIGNAL); } if ((uint16_t)(Q_PAR(me)) & 0b1000) { DS(button4, BUTTON_PRESSED_SIGNAL); } else { DS(button4, BUTTON_RELEASED_SIGNAL); } return Q_HANDLED(); } return Q_SUPER(QHsm_top);}
开发者ID:russells,项目名称:hc2,代码行数:33,
示例9: sql_logoutint sql_logout(cs_request_t *req, sqlite3 *db, buf_t *wbuf){ if (req == NULL || db == NULL || wbuf == NULL || wbuf->data == NULL) { E("parameter error."); return -1; } char *query_line = (char *)cs_malloc(sizeof(char) * QUERY_LEN_MAX); if (query_line == NULL) { E("cs_malloc() failed."); DPSTR(wbuf); return -1; } /* update user info in users table */ sprintf(query_line, "update users set fd=-1 where name='%s'", req->name); DS(query_line); int ret = sqlite3_exec(db, query_line, NULL, NULL, NULL); if (ret != SQLITE_OK) { E("sqlite3_exec() failed."); cs_free(&query_line); return -1; } /* notice all buddy */ memset(query_line, '/0', QUERY_LEN_MAX); sprintf(query_line, "select %s.name, users.fd from %s,users where %s.name=users.name", req->name, req->name, req->name); DS(query_line); ret = sqlite3_exec(db, query_line, sql_notice_buddy_cb, req->name, NULL); if (ret != SQLITE_OK) { E("sqlite3_exec() failed."); cs_free(&query_line); return -1; } strncpy(wbuf->data, "ok", 2); wbuf->len = 2; cs_free(&query_line); /* * find mine fd, fd_clr and close fd. * free mine wrbuf * on L171 cs_server.c where n == 0 */ return 0;}
开发者ID:jesse2013,项目名称:cs,代码行数:50,
示例10: DSvoid TextEditorRemoteNode::processIncomingPacket( const QByteArray &B ){ QDataStream DS( B ); quint16 PacketType = PACKET_UNKNOWN; DS >> PacketType; switch( PacketType ) { case PACKET_UNKNOWN: break; case PACKET_TEXT: receiveTextPacket( DS ); break; case PACKET_HIGHLIGHTER: receiveHighlighter( DS ); break; case PACKET_ERRORS: receiveErrors( DS ); break; }}
开发者ID:bigfug,项目名称:Fugio,代码行数:25,
示例11: QLabelvoid Preferences::createWidgets(){ m_protocolLabel = new QLabel (tr ("Protocol"), this); m_dashboardLabel = new QLabel (tr ("Dashboard"), this); m_teamNumberLabel = new QLabel (tr ("Team Number"), this); m_teamNumber = new QSpinBox (this); m_protocols = new QComboBox (this); m_dashboards = new QComboBox (this); m_practiceTimings = new QGroupBox (tr ("Practice Timings"), this); m_delayLabel = new QLabel (tr ("Delay")); m_teleopLabel = new QLabel (tr ("Teleop")); m_endGameLabel = new QLabel (tr ("End game")); m_countdownLabel = new QLabel (tr ("Countdown")); m_autonomousLabel = new QLabel (tr ("Autonomous")); m_delay = new QSpinBox (this); m_teleop = new QSpinBox (this); m_endGame = new QSpinBox (this); m_countdown = new QSpinBox (this); m_autonomous = new QSpinBox (this); m_delay->setRange (0, 500); m_teleop->setRange (0, 500); m_endGame->setRange (0, 500); m_countdown->setRange (0, 500); m_autonomous->setRange (0, 500); m_teamNumber->setRange (0, 9999); m_protocols->addItems (DS()->protocols()); m_dashboards->addItems (Dashboards::getInstance()->dashboardList()); m_dashboards->setCurrentIndex (Settings::get ("Dashboard", 0).toInt());}
开发者ID:PeterMitrano,项目名称:QDriverStation,代码行数:35,
示例12: sql_find_buddy_fdint sql_find_buddy_fd(cs_request_t *req, sqlite3 *db){ if (req == NULL || req->name == NULL || req->buddy_name == NULL || db == NULL) { E("parameter error."); return -1; } char *query_line = (char *)cs_malloc(sizeof(char) * QUERY_LEN_MAX); if (query_line == NULL) { E("cs_malloc() failed."); return -1; } sprintf(query_line, "select * from users where name='%s'", req->buddy_name); DS(query_line); int fd = 0; int ret = sqlite3_exec(db, query_line, sql_buddy_fd_cb, &fd, NULL); if (ret != SQLITE_OK || fd < 0) { E("sqlite3_exec() failed."); DD(fd); cs_free(&query_line); return -1; } cs_free(&query_line); D(GREEN"user %s fd is %d.", req->buddy_name, fd); return fd;}
开发者ID:jesse2013,项目名称:cs,代码行数:32,
示例13: ATLTRACE_ERRORint CTwain::SetCapOneValue(unsigned Cap, unsigned ItemType, TW_UINT32 ItemVal){ TW_CAPABILITY cap; pTW_ONEVALUE pv; BOOL bSuccess; if (nState != SOURCE_OPEN) { ATLTRACE_ERROR(TWERR_NOT_4); return FALSE; } cap.Cap = (TW_UINT16)Cap; // capability id cap.ConType = TWON_ONEVALUE; // container type do { cap.hContainer = GlobalAlloc(GHND, sizeof (TW_ONEVALUE)); if (!cap.hContainer) { if (IDCANCEL == MessageBox(NULL, _T("Internal error while preparing for TWAIN acquire."), _T("ImageWalker"), MB_RETRYCANCEL | MB_ICONEXCLAMATION)) { return FALSE; } } } while (!cap.hContainer); pv = (pTW_ONEVALUE)GlobalLock(cap.hContainer); pv->ItemType = (TW_UINT16)ItemType; pv->Item = ItemVal; GlobalUnlock(cap.hContainer); bSuccess = DS(DG_CONTROL, DAT_CAPABILITY, MSG_SET, (TW_MEMREF)&cap); GlobalFree(cap.hContainer); return bSuccess;} // SetCapOneValue
开发者ID:ZacWalk,项目名称:ImageWalker,代码行数:33,
示例14: sql_view_infoint sql_view_info(cs_request_t *req, sqlite3 *db, buf_t *wbuf){ if (req == NULL || req->buddy_name == NULL || db == NULL || wbuf == NULL || wbuf->data == NULL) { E("parameter error."); return -1; } /* check log_type */ char *query_line = (char *)cs_malloc(sizeof(char) * QUERY_LEN_MAX); if (query_line == NULL) { E("cs_malloc() failed."); DPSTR(wbuf); return -1; } sprintf(query_line, "select * from users where name='%s'", req->buddy_name); DS(query_line); int ret = sqlite3_exec(db, query_line, sql_get_info_cb, wbuf, NULL); if (ret != SQLITE_OK) { E("sqlite3_exec() failed."); cs_free(&query_line); return -1; } cs_free(&query_line); D(GREEN"view %s info success.", req->buddy_name); return 0;}
开发者ID:jesse2013,项目名称:cs,代码行数:31,
示例15: DSint CTwain::TwainMessageHook(LPMSG lpmsg)// returns TRUE if message processed by TWAIN// FALSE otherwise{ int bProcessed = FALSE; if (nState >= SOURCE_ENABLED) { // source enabled TW_EVENT twEvent; twEvent.pEvent = (TW_MEMREF)lpmsg; twEvent.TWMessage = MSG_NULL; // relay message to source in case it wants it DS(DG_CONTROL, DAT_EVENT, MSG_PROCESSEVENT, &twEvent); bProcessed = (rc == TWRC_DSEVENT); switch (twEvent.TWMessage) { case MSG_XFERREADY: // notify by callback // default callback does transfers XferReady(lpmsg); break; case MSG_CLOSEDSREQ: // notify by callback // default callback closes the source CloseDsRequest(); break; case MSG_NULL: // no message returned from DS break; } // switch } return bProcessed;} // TwainMessageHook
开发者ID:ZacWalk,项目名称:ImageWalker,代码行数:35,
示例16: quitstatic void quit(struct winampVisModule *this_mod){#define DS(x) //MessageBox(this_mod->hwndParent,x,"AVS Debug",MB_OK) if (g_hThread) { DS("Waitin for thread to quit/n"); g_ThreadQuit=1; if (WaitForSingleObject(g_hThread,10000) != WAIT_OBJECT_0) { DS("Terminated thread (BAD!)/n"); //MessageBox(NULL,"error waiting for thread to quit","a",MB_TASKMODAL); TerminateThread(g_hThread,0); } DS("Thread done... calling ddraw_quit/n"); DDraw_Quit(); DS("Calling cfgwnd_destroy/n"); CfgWnd_Destroy(); DS("Calling render_quit/n"); Render_Quit(this_mod->hDllInstance); DS("Calling wnd_quit/n"); Wnd_Quit(); DS("closing thread handle/n"); CloseHandle(g_hThread); g_hThread=NULL; DS("calling eel quit/n"); AVS_EEL_IF_quit(); DS("cleaning up critsections/n"); DeleteCriticalSection(&g_cs); DeleteCriticalSection(&g_render_cs); DS("smp_cleanupthreads/n"); C_RenderListClass::smp_cleanupthreads(); }#undef DS#if 0//syntax highlighting if (hRich) FreeLibrary(hRich); hRich=0;#endif}
开发者ID:majek,项目名称:avs,代码行数:45,
示例17: QWidgetConsole::Console (QWidget* parent) : QWidget (parent){ createWidgets(); createLayouts(); configureStyles(); connect (m_copyButton, SIGNAL (clicked()), this, SLOT (copy())); connect (m_clearButton, SIGNAL (clicked()), this, SLOT (clear())); connect (DS(), SIGNAL (newMessage (QString)), this, SLOT (log (QString)));}
开发者ID:PeterMitrano,项目名称:QDriverStation,代码行数:10,
示例18: EndXferint CTwain::CancelXfers(void){ EndXfer(); // if transferring, cancel it if (nState == TRANSFER_READY) { DS(DG_CONTROL, DAT_PENDINGXFERS, MSG_RESET, &pendingXfers); if (nState == TRANSFER_READY && bTrace) ATLTRACE(_T("TWAIN:CancelXfers failed./n")); } return (nState < TRANSFER_READY);} // CancelXfers
开发者ID:ZacWalk,项目名称:ImageWalker,代码行数:10,
示例19: mainsint mains(){ std::cout<<" Hello World Begin Testing "<<std::endl; string StoreName = "TestStore"; DataStore DS(StoreName); Log ThisLog; //ThisLog<<" Created a datastore "<<endl; return 0;}
开发者ID:pranphy,项目名称:Bepari,代码行数:10,
示例20: sql_del_info_buddy_cbint sql_del_info_buddy_cb(void *p, int argc, char **value, char **name){ destroy_t *dt = (destroy_t *)p; char *query_line = (char *)cs_malloc(sizeof(char) * QUERY_LEN_MAX); if (query_line == NULL) { E("cs_malloc() failed."); return -1; } /* delete user info in buddy table */ sprintf(query_line, "delete from %s where name='%s'", value[1], dt->name); DS(query_line); int ret = sqlite3_exec(dt->db, query_line, NULL, NULL, NULL); if (ret != SQLITE_OK) { E("sqlite3_exec() failed."); cs_free(&query_line); return -1; } /* delete name_buddy tables */ memset(query_line, '/0', QUERY_LEN_MAX); int log_type = atoi(value[2]); if (log_type == 0) sprintf(query_line, "drop table %s_%s", dt->name, value[1]); else if (log_type == 1) sprintf(query_line, "drop table %s_%s", value[1], dt->name); else DD(log_type); DS(query_line); ret = sqlite3_exec(dt->db, query_line, NULL, NULL, NULL); if (ret != SQLITE_OK) { E("sqlite3_exec() failed."); cs_free(&query_line); return -1; } cs_free(&query_line); return 0;}
开发者ID:jesse2013,项目名称:cs,代码行数:42,
示例21: kopp_fc_funcvoidkopp_fc_func(char *in){ int SingleBlkOnly=0; // Default: we will send key off if Keycode >= 0x80uint32_t LastWatchdog;uint8_t blkTXcode=0x00; uint8_t inhex_dec[kopp_fc_Command_char]; // in_decbin: decimal value of hex commandlineuint8_t hblen = fromhex(in+2, inhex_dec, strlen(in)); strcpy(ErrorMSG,"ok"); // If parameter 2 = "t" then "Transmitt Free Control Telegram" SingleBlkOnly=0; // Default: we will send key off if Keycode >= 0x80if((in[1] == 't') || (in[1] == 's')) // Transmitt Command// ================={kopp_fc_tx_on = 1; // Transmitt activatedif (in[15]=='J') printon[0]='Y'; else printon[0]='N'; // Sollen wir Daten ausgeben (Zeitstempel etc)if(in[1] == 's') SingleBlkOnly=1; // Command = "s", -> If KeyCode > 0x80 we will send no !! Key Off CodeLastWatchdog=ticks; // I guess, Watchdog reset was done shortly before BlockStartTime=ticks;// print some status Informationif (printon[0]=='Y') { DS_P(PSTR("Transmitt/r/n")); DS_P(PSTR("commandlineparameter: ")); DS(in); DS_P(PSTR("/r/nStringlength: ")); DU(strlen(in),0); DS_P(PSTR("/r/nNext Character (int) after parameter (should be line end character): ")); DU((int)in[strlen(in)],0); DS_P(PSTR("/r/nAmount of Bytes (Hex) found inside command line parameter: ")); DU(hblen,0); DS_P(PSTR("/r/n")); // following code to check whether ticks uses full 32 bits or will be reset afer 125 ticks DS_P(PSTR("Tick Timer: ")); DH((uint16_t)(( BlockStartTime>>16) & 0xffff),4); DH((uint16_t)(BlockStartTime & 0xffff),4); DS_P(PSTR("/r/n")); }
开发者ID:MariusRumpf,项目名称:a-culfw,代码行数:54,
示例22: mainint main(int argc, char **argv){ DisjointSets DS(5); for (int i = 0; i < 5; ++i) DS.MakeSet(i); DS.Union(0,1); DS.Union(1,2); DS.Union(3,4); cout << DS.Find(0) << ' ' << DS.Find(2) << endl; cout << DS.Find(4) << endl; DS.Union(4,0); cout << DS.Find(0) << ' ' << DS.Find(1) << ' ' << DS.Find(4) << endl; }
开发者ID:hbrausen,项目名称:MiscAlgorithms,代码行数:12,
示例23: DisableSourceint CTwain::CloseSource(void){ rc = TWRC_SUCCESS; if (nState == SOURCE_ENABLED) { DisableSource(); } if (nState == SOURCE_OPEN) { DS(DG_CONTROL, DAT_IDENTITY, MSG_CLOSEDS, &SourceId); if (nState == SOURCE_OPEN && bTrace) ATLTRACE(_T("TWAIN:CloseSource failed./n")); } return (nState < SOURCE_OPEN);} // CloseSource
开发者ID:ZacWalk,项目名称:ImageWalker,代码行数:13,
示例24: DSint YARPMEIDeviceDriver::getSpeeds(void *spds){ long rc = 0; double *out = (double *) spds; DSP_DM vel; for(int i = 0; i < _njoints; i++) { P_DSP_DM current_v_addr = dspPtr->data_struct + DS_CURRENT_VEL + DS(i); pcdsp_transfer_block(dspPtr, TRUE, FALSE, current_v_addr, 1, &vel); out[i] = vel*_dsp_rate; } return rc;}
开发者ID:robotology-legacy,项目名称:yarp1,代码行数:13,
示例25: GetImageLayoutint CTwain::GetImageLayout(double &left, double &top, double &width, double &height){ TW_IMAGELAYOUT layout; if (DS(DG_IMAGE, DAT_IMAGELAYOUT, MSG_GET, &layout)) { left = Fix32ToFloat(layout.Frame.Left); top = Fix32ToFloat(layout.Frame.Top); width = Fix32ToFloat(layout.Frame.Right) - left; height = Fix32ToFloat(layout.Frame.Bottom) - top; return TRUE; } else { left = top = width = height = 0.0; return FALSE; }} // SetImageLayout
开发者ID:ZacWalk,项目名称:ImageWalker,代码行数:14,
示例26: X int X(have_simd_sse2)(void) { static int init = 0, res; if (!init) { res = !is_386() && has_cpuid() && (cpuid_edx(1) & (1 << DS(26,25))) && sse2_works(); init = 1; X(check_alignment_of_sse2_pm)(); } return res; }
开发者ID:dpl0,项目名称:bioinformatics,代码行数:14,
注:本文中的DS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DSA_OpenSSL函数代码示例 C++ DRect函数代码示例 |