bool CBaseBandTestProc::Handle() { int iErrorcode; if(!DoProcess()) { m_pPhone->CloseComport();; return false; } LogTrace(MSG_MID,_T(" Write EFS !")) if((iErrorcode=m_pPhone->WriteEFS(30000))!=PHONE_SUCCESS) { LogTrace(MSG_ERROR,_T(" Phone WriteEFS Fail!")) m_iErrorcode=iErrorcode; CalFailLog(_T("_"),_T("_"),iErrorcode," Phone WriteEFS Fail!"); return false; } /*if((iErrorcode=m_pPhone->ReloadNV())!=PHONE_SUCCESS) { LogTrace(MSG_ERROR,_T(" Phone Reload NV Fail!")) m_iErrorcode=iErrorcode; CalFailLog(_T("_"),_T("_"),iErrorcode," Phone Reload NV Fail!"); return false; }*/ return true; }
bool PrePostProcessor::Process() { if(!PreProcess()) return false; if(!DoProcess()) return false; if(!PostProcess()) return false; return ProcessNextMethod(); }
void DistrhoPluginCycleShifter::run(const float** inputs, float** outputs, uint32_t frames) { const float* in = inputs[0]; /**/ float* out = outputs[0]; for (uint32_t i=0; i<frames; ++i) *out++ = DoProcess(*in++); }
void MakePaster(struct paster *pa, char *buf, int len, int bufiscopy) { FreePaster(pa); pa->pa_pasteptr = buf; pa->pa_pastelen = len; if (bufiscopy) pa->pa_pastebuf = buf; pa->pa_pastelayer = flayer; DoProcess(Layer2Window(flayer), &pa->pa_pasteptr, &pa->pa_pastelen, pa); }
bool CGeneralTest::Handle() { if(!DoProcess()) { return false; } return true; }
bool CCDMATestEnd::Handle() { if(!DoProcess()) { EndCall(); return false; } EndCall(); return true; }
bool PushButton::IsJustReleased() { DoProcess(); if (_IsReleased) { _IsReleased = false; return true; } return false; }
bool PushButton::IsJustPressed() { DoProcess(); if (_IsPushed) { _IsPushed = false; return true; } return false; }
std::string BaseHandler::getResponseHeaders() { if(!_hasProcessed) DoProcess(); std::string header(_http_Response->_protocal+" "); header.append(_http_Response->_status+"\r\n"); header.append("Content-Type: "+_http_Response->_content_Type+"\r\n"); header.append("Content-Length: "); header.append(sizeToString(_http_Response->_content_Length)+"\r\n"); header.append("\r\n"); return header; }
bool CKVCOCal::Handle() { if(!DoProcess()) { m_pPhone->CloseComport(); return false; } return true; }
bool CDualCarrier::Handle() { if(!DoProcess()) { m_pPhone->CloseComport(); m_pFunWCDMACalDev->Deivce_Exit(); return false; } CalPassLog("_","_","WCDMA DualCarrier Cal Pass"); return true; }
EXPORT_C void CStreamCipher::Process(const TDesC8& aInput, TDes8& aOutput) { TInt outputIndex = aOutput.Size(); // aOutput may already have outputIndex bytes of data in it // check there will still be enough space to process the result __ASSERT_DEBUG(aOutput.MaxLength() - outputIndex >= MaxOutputLength(aInput.Length()), User::Panic(KCryptoPanic, ECryptoPanicOutputDescriptorOverflow)); aOutput.Append(aInput); TPtr8 transformBuf((TUint8*)(aOutput.Ptr()) + outputIndex, aInput.Size(), aInput.Size()); DoProcess(transformBuf); }
void CppCheckPlugin::DoStartTest(ProjectPtr proj /*=NULL*/) { RemoveExcludedFiles(); if (!m_filelist.GetCount()) { wxMessageBox(_("No files to check"), "CppCheck", wxOK|wxCENTRE, m_mgr->GetTheApp()->GetTopWindow()); return; } SetTabVisible(true); m_view->Clear(); m_view->SetGaugeRange(m_filelist.GetCount()); // We need to load any project-specific settings: definitions and undefines // (We couldn't do that with the rest of the settings as the workspace hadn't yet been loaded) m_settings.LoadProjectSpecificSettings(proj); // NB we still do this if !proj, as that will clear any stale settings // Start the test DoProcess(); }
/////////////////////// // // IMediaObjectInPlace::Process // // The Process method processes a block of data. The application supplies a // pointer to a block of input data. The DMO processes the data in place. // // Parameters // // ulSize // [in] Size of the data, in bytes. // // pData // [in, out] Pointer to a buffer of size ulSize. On input, the buffer // holds the input data. If the method returns successfully, the // buffer contains the output data. // // refTimeStart // [in] Start time of the data. // // dwFlags // [in] Either DMO_INPLACE_NORMAL or DMO_INPLACE_ZERO. See Remarks // for more information. // // Return Value // S_FALSE Success. There is still data to process. // S_TRUE Success. There is no remaining data to process. // E_FAIL Failure. // // If the method fails, the buffer might contain garbage. The application // should not use the contents of the buffer. // // The DMO might produce output data beyond the length of the input data. This // is called an effect tail. For example, a reverb effect continues after the // input reaches silence. If the DMO has an effect tail, this method returns // S_FALSE. // // While the application has input data for processing, call the Process // method with the dwFlags parameter set to DMO_INPLACE_NORMAL. If the last // such call returns S_FALSE, call Process again, this time with a zeroed input // buffer and the DMO_INPLACE_ZERO flag. The DMO will now fill the zeroed buffer // with the effect tail. Continue calling Process in this way until the return // value is S_TRUE, indicating that the DMO has finished processing the effect // tail. // // If the DMO has no effect tail, this method always returns S_TRUE (or an error code). // HRESULT CHXAudioDeviceHookBase::Process(ULONG ulSize, BYTE *pData, REFERENCE_TIME refTimeStart, DWORD dwFlags) { // TODO: Modify implementation of Process() if necessary HRESULT hr = S_OK; if (!m_fInitialized) { hr = AllocateStreamingResources(); } if (SUCCEEDED(hr)) { // Process the data hr = DoProcess(pData, pData, ulSize / WaveFormat()->nBlockAlign); } return hr; }
bool wxDebugReport::Process() { if ( !GetFilesCount() ) { wxLogError(_("Debug report generation has failed.")); return false; } if ( !DoProcess() ) { wxLogError(_("Processing debug report has failed, leaving the files in \"%s\" directory."), GetDirectory().c_str()); Reset(); return false; } return true; }
bool TSimpleTextMiner::Run() { if (Input == NULL || Output == NULL) return false; Wtroka text; SDocumentAttribtes docAttr; ETypeOfDocument type; while (DoInput(text, docAttr, type)) { bool res = DoProcess(text, docAttr, type); if (res) res = DoOutput(docAttr); if (!res && Errors != NULL && dynamic_cast<TStringStream*>(ErrorStream) != NULL) { TStringStream* str = static_cast<TStringStream*>(ErrorStream); Errors->OutputError(str->Str()); str->clear(); } } return true; }
void TCmdQueue::Process() { while (DoProcess()); }
/*************************************************************//** * * @brief 処理を行う * @param 剛体 * @return なし * ****************************************************************/ void C_RigidBodyMoveLogic::Process(RigidBody* pRigidBody) { DoProcess(pRigidBody); }
/////////////////////////////////// // // IMediaObjectImpl::InternalProcessOutput // // *** Called by ProcessOutput, description below *** // // The ProcessOutput method generates output from the current input data. // // Parameters // // dwFlags // Bitwise combination of zero or more flags from the // DMO_PROCESS_OUTPUT_FLAGS enumeration. // // cOutputBufferCount // Number of output buffers. // // pOutputBuffers // [in, out] Pointer to an array of DMO_OUTPUT_DATA_BUFFER structures // containing the output buffers. Specify the size of the array in the // cOutputBufferCount parameter. // // pdwStatus // [out] Pointer to a variable that receives a reserved value (zero). // The application should ignore this value. // // Return Value // S_FALSE No output was generated // S_OK Success // E_FAIL Failure // E_INVALIDARG Invalid argument // E_POINTER NULL pointer argument // // The pOutputBuffers parameter points to an array of DMO_OUTPUT_DATA_BUFFER // structures. The application must allocate one structure for each output // stream. To determine the number of output streams, call the GetStreamCount // method. Set the cOutputBufferCount parameter to this number. // // Each DMO_OUTPUT_DATA_BUFFER structure contains a pointer to a buffer's // IMediaBuffer interface. The application allocates these buffers. The other // members of the structure are status fields. The DMO sets these fields if // the method succeeds. If the method fails, their values are undefined. // // When the application calls ProcessOutput, the DMO processes as much input // data as possible. It writes the output data to the output buffers, starting // from the end of the data in each buffer. (To find the end of the data, call // the IMediaBuffer::GetBufferAndLength method.) The DMO never holds a // reference count on an output buffer. // // If the DMO fills an entire output buffer and still has input data to // process, the DMO returns the DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE flag in the // DMO_OUTPUT_DATA_BUFFER structure. The application should check for this // flag by testing the dwStatus member of each structure. // // If the method returns S_FALSE, no output was generated. However, a DMO is // not required to return S_FALSE in this situation; it might return S_OK. // // Discarding data: // // You can discard data from a stream by setting the // DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER flag in the dwFlags parameter. // For each stream that you want to discard, set the pBuffer member of the // DMO_OUTPUT_DATA_BUFFER structure to NULL. // // For each stream in which pBuffer is NULL: // // If the DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER flag is set, and the // stream is discardable or optional, the DMO discards the data. // // If the flag is set but the stream is neither discardable nor optional, the // DMO discards the data if possible. It is not guaranteed to discard the // data. // // If the flag is not set, the DMO does not produce output data for that // stream, but does not discard the data. // // To check whether a stream is discardable or optional, call the // GetOutputStreamInfo method. // // Note: // // Before this method calls InternalProcessOutput, it calls // AllocateStreamingResources. Therefore, the implementation of // InternalProcessOutput can assume that all resources have been allocated. // HRESULT CHXAudioDeviceHookBase::InternalProcessOutput(DWORD dwFlags, DWORD cOutputBufferCount, DMO_OUTPUT_DATA_BUFFER *pOutputBuffers, DWORD *pdwStatus) { // TODO: Complete or modify implementation of InternalProcessOutput() if necessary HRESULT hr = S_OK; BYTE *pbData = NULL; DWORD cbData = 0; DWORD cbOutputLength = 0; DWORD cbBytesProcessed = 0; bool bComplete = false; const DWORD UNITS = 10000000; // 1 sec = 100 * UNITS ns CComPtr<IMediaBuffer> pOutputBuffer = pOutputBuffers[0].pBuffer; if (!m_pBuffer || !pOutputBuffer) { return S_FALSE; // Did not produce output } // Get the size of the output buffer hr = pOutputBuffer->GetBufferAndLength(&pbData, &cbData); if (SUCCEEDED(hr)) { hr = pOutputBuffer->GetMaxLength(&cbOutputLength); } if (SUCCEEDED(hr)) { // Skip past any valid data in the output buffer pbData += cbData; cbOutputLength -= cbData; // Calculate how many quanta we can process if (m_cbInputLength > cbOutputLength) { cbBytesProcessed = cbOutputLength; } else { cbBytesProcessed = m_cbInputLength; bComplete = true; } // Process the data hr = DoProcess(pbData, m_pbInputData, cbBytesProcessed / WaveFormat()->nBlockAlign); } if (SUCCEEDED(hr)) { hr = pOutputBuffer->SetLength(cbBytesProcessed + cbData); } if (SUCCEEDED(hr)) { if (m_bValidTime) { pOutputBuffers[0].dwStatus |= DMO_OUTPUT_DATA_BUFFERF_TIME; pOutputBuffers[0].rtTimestamp = m_rtTimestamp; // Estimate how far along we are pOutputBuffers[0].dwStatus |= DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH; double dTime = (double)(cbBytesProcessed) / WaveFormat()->nAvgBytesPerSec; pOutputBuffers[0].rtTimelength = (REFERENCE_TIME)(dTime * UNITS); } if (bComplete) { m_pBuffer = NULL; // Release input buffer } else { pOutputBuffers[0].dwStatus |= DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE; m_cbInputLength -= cbBytesProcessed; m_pbInputData += cbBytesProcessed; m_rtTimestamp += pOutputBuffers[0].rtTimelength; } } return hr; }
//--------------< get response body >------------ void BaseHandler::getResponseBody(const char** memoryBlock) { if (!_hasProcessed) DoProcess(); *memoryBlock = _http_Response->_reponse_Resource; }
static void ProcessSingleRecord ( CharPtr filename, CSpeedFlagPtr cfp ) { AsnIoPtr aip; BioseqPtr bsp; ValNodePtr bsplist = NULL; BioseqSetPtr bssp; Pointer dataptr = NULL; Uint2 datatype, entityID = 0; FileCache fc; FILE *fp; Int1 iotype; Char line [512]; Int4 maxio = 1; SeqEntryPtr sep; time_t starttime, stoptime, worsttime; CharPtr str; Int4 x; if (cfp == NULL) return; if (StringHasNoText (filename)) return; if (StringChr (cfp->io, 'r') != NULL) { maxio = cfp->maxcount; } starttime = GetSecs (); for (x = 0; x < maxio; x++) { if (entityID != 0) { ObjMgrFreeByEntityID (entityID); entityID = 0; dataptr = NULL; } if (cfp->type == 1) { fp = FileOpen (filename, "r"); if (fp == NULL) { Message (MSG_POSTERR, "Failed to open '%s'", filename); return; } dataptr = ReadAsnFastaOrFlatFile (fp, &datatype, NULL, FALSE, FALSE, FALSE, FALSE); FileClose (fp); entityID = ObjMgrRegister (datatype, dataptr); } else if (cfp->type >= 2 && cfp->type <= 5) { aip = AsnIoOpen (filename, cfp->binary? "rb" : "r"); if (aip == NULL) { Message (MSG_POSTERR, "AsnIoOpen failed for input file '%s'", filename); return; } switch (cfp->type) { case 2 : dataptr = (Pointer) SeqEntryAsnRead (aip, NULL); datatype = OBJ_SEQENTRY; break; case 3 : dataptr = (Pointer) BioseqAsnRead (aip, NULL); datatype = OBJ_BIOSEQ; break; case 4 : dataptr = (Pointer) BioseqSetAsnRead (aip, NULL); datatype = OBJ_BIOSEQSET; break; case 5 : dataptr = (Pointer) SeqSubmitAsnRead (aip, NULL); datatype = OBJ_SEQSUB; break; default : break; } AsnIoClose (aip); entityID = ObjMgrRegister (datatype, dataptr); } else if (cfp->type == 6) { fp = FileOpen (filename, "r"); if (fp == NULL) { Message (MSG_POSTERR, "Failed to open '%s'", filename); return; } dataptr = ReadAsnFastaOrFlatFile (fp, &datatype, NULL, FALSE, FALSE, FALSE, FALSE); FileClose (fp); entityID = ObjMgrRegister (datatype, dataptr); } else if (cfp->type == 7) { fp = FileOpen (filename, "r"); if (fp == NULL) { Message (MSG_POSTERR, "Failed to open '%s'", filename); return; } FileCacheSetup (&fc, fp); str = FileCacheReadLine (&fc, line, sizeof (line), NULL); while (str != NULL) { str = FileCacheReadLine (&fc, line, sizeof (line), NULL); } FileClose (fp); return; } else { Message (MSG_POSTERR, "Input format type '%d' unrecognized", (int) cfp->type); return; } } if (entityID < 1 || dataptr == NULL) { Message (MSG_POSTERR, "Data read failed for input file '%s'", filename); return; } if (datatype == OBJ_SEQSUB || datatype == OBJ_SEQENTRY || datatype == OBJ_BIOSEQ || datatype == OBJ_BIOSEQSET) { stoptime = GetSecs (); worsttime = stoptime - starttime; if (cfp->logfp != NULL) { fprintf (cfp->logfp, "ASN reading time %ld seconds\n", (long) worsttime); fflush (cfp->logfp); } sep = GetTopSeqEntryForEntityID (entityID); if (sep == NULL) { sep = SeqEntryNew (); if (sep != NULL) { if (datatype == OBJ_BIOSEQ) { bsp = (BioseqPtr) dataptr; sep->choice = 1; sep->data.ptrvalue = bsp; SeqMgrSeqEntry (SM_BIOSEQ, (Pointer) bsp, sep); } else if (datatype == OBJ_BIOSEQSET) { bssp = (BioseqSetPtr) dataptr; sep->choice = 2; sep->data.ptrvalue = bssp; SeqMgrSeqEntry (SM_BIOSEQSET, (Pointer) bssp, sep); } else { sep = SeqEntryFree (sep); } } sep = GetTopSeqEntryForEntityID (entityID); } if (sep != NULL) { if (cfp->lock) { starttime = GetSecs (); bsplist = LockFarComponents (sep); stoptime = GetSecs (); worsttime = stoptime - starttime; if (cfp->logfp != NULL) { fprintf (cfp->logfp, "Far component locking time %ld seconds\n", (long) worsttime); fflush (cfp->logfp); } } if (StringChr (cfp->io, 'w') != NULL) { starttime = GetSecs (); iotype = ASNIO_TEXT_OUT; if (StringChr (cfp->io, 'b') != NULL) { iotype = ASNIO_BIN_OUT; } for (x = 0; x < cfp->maxcount; x++) { aip = AsnIoNew (iotype, cfp->ofp, NULL, NULL, NULL); if (aip != NULL) { SeqEntryAsnWrite (sep, aip, NULL); AsnIoFree (aip, FALSE); } } stoptime = GetSecs (); worsttime = stoptime - starttime; if (cfp->logfp != NULL) { fprintf (cfp->logfp, "ASN writing time %ld seconds\n", (long) worsttime); fflush (cfp->logfp); } } starttime = GetSecs (); for (x = 0; x < cfp->maxcount; x++) { DoProcess (sep, entityID, cfp); } stoptime = GetSecs (); worsttime = stoptime - starttime; if (cfp->logfp != NULL) { fprintf (cfp->logfp, "Internal processing time %ld seconds\n", (long) worsttime); fflush (cfp->logfp); } ObjMgrFreeByEntityID (entityID); bsplist = UnlockFarComponents (bsplist); } } else { Message (MSG_POSTERR, "Datatype %d not recognized", (int) datatype); } }
unsigned int BaseHandler::getResponseLength() { if (!_hasProcessed) DoProcess(); return _http_Response->_content_Length; }
bool PushButton::IsDown() { DoProcess(); return !GetValue(); }
static void ProcessMultipleRecord ( CharPtr filename, CSpeedFlagPtr cfp ) { AsnIoPtr aip; AsnTypePtr atp; BioseqPtr bsp; Char buf [41]; Uint2 entityID; FILE *fp; SeqEntryPtr fsep; Char longest [41]; Int4 numrecords, x; SeqEntryPtr sep; time_t starttime, stoptime, worsttime; #ifdef OS_UNIX Char cmmd [256]; CharPtr gzcatprog; int ret; Boolean usedPopen = FALSE; #endif if (cfp == NULL) return; if (StringHasNoText (filename)) return; #ifndef OS_UNIX if (cfp->compressed) { Message (MSG_POSTERR, "Can only decompress on-the-fly on UNIX machines"); return; } #endif #ifdef OS_UNIX if (cfp->compressed) { gzcatprog = getenv ("NCBI_UNCOMPRESS_BINARY"); if (gzcatprog != NULL) { sprintf (cmmd, "%s %s", gzcatprog, filename); } else { ret = system ("gzcat -h >/dev/null 2>&1"); if (ret == 0) { sprintf (cmmd, "gzcat %s", filename); } else if (ret == -1) { Message (MSG_POSTERR, "Unable to fork or exec gzcat in ScanBioseqSetRelease"); return; } else { ret = system ("zcat -h >/dev/null 2>&1"); if (ret == 0) { sprintf (cmmd, "zcat %s", filename); } else if (ret == -1) { Message (MSG_POSTERR, "Unable to fork or exec zcat in ScanBioseqSetRelease"); return; } else { Message (MSG_POSTERR, "Unable to find zcat or gzcat in ScanBioseqSetRelease - please edit your PATH environment variable"); return; } } } fp = popen (cmmd, /* cfp->binary? "rb" : */ "r"); usedPopen = TRUE; } else { fp = FileOpen (filename, cfp->binary? "rb" : "r"); } #else fp = FileOpen (filename, cfp->binary? "rb" : "r"); #endif if (fp == NULL) { Message (MSG_POSTERR, "FileOpen failed for input file '%s'", filename); return; } aip = AsnIoNew (cfp->binary? ASNIO_BIN_IN : ASNIO_TEXT_IN, fp, NULL, NULL, NULL); if (aip == NULL) { Message (MSG_ERROR, "AsnIoNew failed for input file '%s'", filename); return; } if (cfp->logfp != NULL) { fprintf (cfp->logfp, "%s\n\n", filename); fflush (cfp->logfp); } longest [0] = '\0'; worsttime = 0; numrecords = 0; atp = cfp->atp_bss; while ((atp = AsnReadId (aip, cfp->amp, atp)) != NULL) { if (atp == cfp->atp_se) { sep = SeqEntryAsnRead (aip, atp); if (sep != NULL) { entityID = ObjMgrGetEntityIDForChoice (sep); fsep = FindNthBioseq (sep, 1); if (fsep != NULL && fsep->choice == 1) { bsp = (BioseqPtr) fsep->data.ptrvalue; if (bsp != NULL) { SeqIdWrite (bsp->id, buf, PRINTID_FASTA_LONG, sizeof (buf)); if (cfp->logfp != NULL) { fprintf (cfp->logfp, "%s\n", buf); fflush (cfp->logfp); } } } starttime = GetSecs (); for (x = 0; x < cfp->maxcount; x++) { DoProcess (sep, entityID, cfp); } stoptime = GetSecs (); if (stoptime - starttime > worsttime) { worsttime = stoptime - starttime; StringCpy (longest, buf); } numrecords++; ObjMgrFreeByEntityID (entityID); } } else { AsnReadVal (aip, atp, NULL); } } AsnIoFree (aip, FALSE); #ifdef OS_UNIX if (usedPopen) { pclose (fp); } else { FileClose (fp); } #else FileClose (fp); #endif if (cfp->logfp != NULL && (! StringHasNoText (longest))) { fprintf (cfp->logfp, "Longest processing time %ld seconds on %s\n", (long) worsttime, longest); fprintf (cfp->logfp, "Total number of records %ld\n", (long) numrecords); fflush (cfp->logfp); } }