本文整理汇总了C++中processBlock函数的典型用法代码示例。如果您正苦于以下问题:C++ processBlock函数的具体用法?C++ processBlock怎么用?C++ processBlock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了processBlock函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc, char *argv[])
{
if( argc != 3 ) {
usage( "%s <errors|noerrors> <gaps|nogaps>", argv[0]);
return -1;
}
MrfEntry *currEntry;
MrfBlock *currBlock;
int i, error, errorCode, numErrors;
int gaps = 0;
if( strEqual( "gaps", argv[2] ) )
gaps = 1;
seq_init();
mrf_init ("-");
printf( "%s\n", mrf_writeHeader());
numErrors = 0;
while (currEntry = mrf_nextEntry ()) {
error = 0;
for( i=0; i<arrayMax(currEntry->read1.blocks); i++) {
currBlock=arrp( currEntry->read1.blocks, i, MrfBlock);
if( i==0 ) {
errorCode = processBlock ( currBlock, NULL, gaps );
} else {
errorCode = processBlock ( currBlock, arrp( currEntry->read1.blocks, i-1, MrfBlock ), gaps );
}
if( errorCode != 0 ) {
warn( "Error code (read1): %d\t%s:%c:%d:%d:%d:%d", errorCode, currBlock->targetName, currBlock->strand, currBlock->targetStart,
currBlock->targetEnd, currBlock->queryStart, currBlock->queryEnd);
error++;
}
}
if (currEntry->isPairedEnd & error == 0) {
for( i=0; i<arrayMax(currEntry->read2.blocks); i++) {
currBlock=arrp( currEntry->read2.blocks, i, MrfBlock);
if( i==0 ) {
errorCode = processBlock ( currBlock, NULL , gaps );
} else {
errorCode = processBlock (currBlock, arrp( currEntry->read2.blocks, i-1, MrfBlock) , gaps);
}
if( errorCode !=0 ) {
warn( "Error code (read2): %d\t%s:%c:%d:%d:%d:%d", errorCode, currBlock->targetName, currBlock->strand, currBlock->targetStart,
currBlock->targetEnd, currBlock->queryStart, currBlock->queryEnd);
error++;
}
}
}
if( error > 0 && strEqual(argv[1], "errors")) {
printf( "%s\n", mrf_writeEntry( currEntry ));
error=0;
numErrors++;
}
if( error == 0 && strEqual(argv[1], "noerrors"))
printf( "%s\n", mrf_writeEntry( currEntry ));
}
mrf_deInit ();
warn("%s: done", argv[0]);
return 0;
}
开发者ID:gersteinlab,项目名称:RSEQtools,代码行数:59,代码来源:mrfValidate.c
示例2: visit
virtual void visit(AstNodeIf* nodep, AstNUser*) {
if (!m_reorder) {
nodep->iterateChildren(*this);
} else {
UINFO(4," IF "<<nodep<<endl);
nodep->condp()->iterateAndNext(*this);
processBlock(nodep->ifsp());
processBlock(nodep->elsesp());
}
}
开发者ID:phb,项目名称:verilator-asserts,代码行数:10,代码来源:V3Split.cpp
示例3: main
void main(void)
{
InitPLL ();
SetupIRQ12 () ;
// Need to initialize DAI because the sport signals
// need to be routed
InitDAI();
// This function will configure the codec on the kit
Init1835viaSPI();
// Finally setup the sport to receive / transmit the data
InitSPORT();
interrupt (SIG_SP0,TalkThroughISR);
interrupt (SIG_IRQ1, Irq1ISR) ;
interrupt (SIG_IRQ2, Irq2ISR) ;
// Be in infinite loop and do nothing until done.
for(;;)
{
while(blockReady)
processBlock(src_pointer[int_cntr]);
}
}
开发者ID:alpereira7,项目名称:SharcDSPHarmonizer,代码行数:28,代码来源:main.c
示例4: processTable
void XmlWriter::processFrame(QDomElement &parent, QTextFrame *frame)
{
QDomElement frameElement = document->createElement("frame");
frameElement.setAttribute("begin", frame->firstPosition());
frameElement.setAttribute("end", frame->lastPosition());
parent.appendChild(frameElement);
//! [0]
QTextFrame::iterator it;
for (it = frame->begin(); !(it.atEnd()); ++it) {
QTextFrame *childFrame = it.currentFrame();
QTextBlock childBlock = it.currentBlock();
if (childFrame) {
QTextTable *childTable = qobject_cast<QTextTable*>(childFrame);
if (childTable)
processTable(frameElement, childTable);
else
processFrame(frameElement, childFrame);
} else if (childBlock.isValid())
//! [0] //! [1]
processBlock(frameElement, childBlock);
}
//! [1]
}
开发者ID:Fale,项目名称:qtmoko,代码行数:28,代码来源:xmlwriter.cpp
示例5: visit
virtual void visit(AstAlways* nodep) {
UINFO(4," ALW "<<nodep<<endl);
if (debug()>=9) nodep->dumpTree(cout," alwIn:: ");
scoreboardClear();
processBlock(nodep->bodysp());
if (debug()>=9) nodep->dumpTree(cout," alwOut: ");
}
开发者ID:jeras,项目名称:verilator,代码行数:7,代码来源:V3Split.cpp
示例6: update
void update(const void* buffer, std::size_t size)
{
if (size == 0)
return;
if (m_finalized)
throw std::logic_error("sha1: update() called after digest()");
if (!buffer)
throw std::invalid_argument("sha1: null input buffer");
const auto message_array = (const std::uint8_t*)buffer;
for (auto i = 0u; i != size; ++i)
{
m_block[m_blockPos++] = message_array[i];
m_totalBits += 8;
if (m_totalBits == 0)
throw std::length_error("sha1: message is too long");
if (m_blockPos == BLOCK_SIZE)
processBlock();
}
}
开发者ID:ascheglov,项目名称:websocket-cpp,代码行数:25,代码来源:sha1.hpp
示例7: qDebug
void NetworkClient::dataReady()
{
if (m_blockSize == 0)
{
char data[256];
int bytes = m_socket->readLine((char*)&data,256);
if(bytes == -1)
qDebug() << "NetworkClient::dataReady: Could not read line from socket";
else
sscanf((const char*)&data,"%d",&m_blockSize);
//qDebug() << "Read:["<<data<<"], size:"<<m_blockSize;
//log(QString("[DEBUG] NetworkClient::dataReady(): blockSize: %1 (%2)").arg(m_blockSize).arg(m_socket->bytesAvailable()));
}
if (m_socket->bytesAvailable() < m_blockSize)
return;
m_dataBlock = m_socket->read(m_blockSize);
m_blockSize = 0;
if(m_dataBlock.size() > 0)
{
//qDebug() << "Data ("<<m_dataBlock.size()<<"/"<<m_blockSize<<"): "<<m_dataBlock;
//log(QString("[DEBUG] NetworkClient::dataReady(): dataBlock: \n%1").arg(QString(m_dataBlock)));
processBlock();
}
if(m_socket->bytesAvailable())
{
QTimer::singleShot(0, this, SLOT(dataReady()));
}
}
开发者ID:dtbinh,项目名称:dviz,代码行数:35,代码来源:NetworkClient.cpp
示例8: sizeof
void MjpegClient::dataReady()
{
m_blockSize = m_socket->bytesAvailable();
char * data = (char*)malloc(m_blockSize * sizeof(char));
if(data == NULL)
{
qDebug() << "Error allocating memory for incomming data - asked for "<<m_blockSize<<" bytes, got nothing, exiting.";
exit();
return;
}
int bytesRead = m_socket->read(data,m_blockSize);
if(bytesRead > 0)
{
m_dataBlock.append(data,m_blockSize);
processBlock();
}
free(data);
data = 0;
if(m_socket->bytesAvailable())
{
QTimer::singleShot(0, this, SLOT(dataReady()));
}
}
开发者ID:dtbinh,项目名称:dviz,代码行数:27,代码来源:MjpegClient.cpp
示例9: processBlock
void MjpegClient::dataReady()
{
QByteArray bytes = m_socket->readAll();
if(bytes.size() > 0)
{
m_dataBlock.append(bytes);
processBlock();
}
}
开发者ID:dtbinh,项目名称:dviz,代码行数:9,代码来源:MjpegClient.cpp
示例10: DEBUG_INFO
void InputMatrix::calculate(IrredundantMatrix &irredundantMatrix)
{
auto maxThreads = std::thread::hardware_concurrency();;
DEBUG_INFO("MaxThreads: " << maxThreads);
std::vector<std::thread> threads(maxThreads);
MasterWorkerPlan planBuilder(_r2Counts.data(), _r2Counts.size());
for(auto threadId = 0; threadId < maxThreads; ++threadId) {
START_COLLECT_TIME(threading, Counters::Threading);
threads[threadId] = std::thread([this, threadId, &irredundantMatrix, &planBuilder]()
{
TimeCollector::ThreadInitialize();
#ifdef DIFFERENT_MATRICES
IrredundantMatrix matrixForThread(_qColsCount);
auto currentMatrix = &matrixForThread;
#else
auto currentMatrix = &irredundantMatrix;
#endif
DEBUG_INFO("Thread " << threadId << " started");
for(;;) {
auto task = planBuilder.getTask();
if (task->isEmpty()) {
DEBUG_INFO("Thread " << threadId << " stopped");
break;
}
DEBUG_INFO("Thread " << threadId << " is working on " << task->getFirst() << ":" << task->getSecond());
#ifdef DIFFERENT_MATRICES
matrixForThread.clear();
#endif
processBlock(*currentMatrix,
_r2Indexes[task->getFirst()], _r2Counts[task->getFirst()],
_r2Indexes[task->getSecond()], _r2Counts[task->getSecond()]);
#ifdef DIFFERENT_MATRICES
irredundantMatrix.addMatrixConcurrent(std::move(matrixForThread));
#endif
}
TimeCollector::ThreadFinalize();
});
STOP_COLLECT_TIME(threading);
}
for(auto threadId = 0; threadId < maxThreads; ++threadId) {
threads[threadId].join();
}
}
开发者ID:zZLOiz,项目名称:multithread_test_construction,代码行数:56,代码来源:input_matrix.cpp
示例11: while
/// add arbitrary number of bytes
void SHA3::add(const void* data, size_t numBytes)
{
const uint8_t* current = (const uint8_t*) data;
// copy data to buffer
if (m_bufferSize > 0)
{
while (numBytes > 0 && m_bufferSize < m_blockSize)
{
m_buffer[m_bufferSize++] = *current++;
numBytes--;
}
}
// full buffer
if (m_bufferSize == m_blockSize)
{
processBlock((void*)m_buffer);
m_numBytes += m_blockSize;
m_bufferSize = 0;
}
// no more data ?
if (numBytes == 0)
return;
// process full blocks
while (numBytes >= m_blockSize)
{
processBlock(current);
current += m_blockSize;
m_numBytes += m_blockSize;
numBytes -= m_blockSize;
}
// keep remaining bytes in buffer
while (numBytes > 0)
{
m_buffer[m_bufferSize++] = *current++;
numBytes--;
}
}
开发者ID:AIS-Bonn,项目名称:humanoid_op_ros,代码行数:43,代码来源:sha3.cpp
示例12: while
void LevelXmlParser::processMap(xmlNodePtr cur, Level* level)
{
xmlNodePtr child = cur->xmlChildrenNode;
while (child != NULL)
{
if (!xmlStrcmp(child->name, (const xmlChar*)"block"))
{
processBlock(child, level);
}
child = child->next;
}
}
开发者ID:jluqu,项目名称:fugue,代码行数:12,代码来源:LevelXmlParser.cpp
示例13: dataProcessed
void CPUProcessor::blockProcessed()
{
if (blocksCountToProcess > 0)
blocksCountToProcess--;
if (blocksCountToProcess == 0)
{
emit dataProcessed();
delete[] blocks;
blocks = new float[blocksCount * blockSize];
blocksCountToProcess = blocksCount;
emit processBlock(blocks, results);
}
}
开发者ID:goganchic,项目名称:QT_CUDA_computing,代码行数:14,代码来源:cpuprocessor.cpp
示例14: main
int main(void) {
#ifdef STARTUP_CODE
memcpy(_sidata, _sdata, _sdata-_edata); // Copy the data segment initializers
memset(_sbss, 0, _ebss-_sbss); // zero fill the BSS segment
__libc_init_array(); // Call static constructors
#endif /* STARTUP_CODE */
#ifdef DEBUG_DWT
volatile unsigned int *DWT_CYCCNT = (volatile unsigned int *)0xE0001004; //address of the register
volatile unsigned int *DWT_CONTROL = (volatile unsigned int *)0xE0001000; //address of the register
volatile unsigned int *SCB_DEMCR = (volatile unsigned int *)0xE000EDFC; //address of the register
*SCB_DEMCR = *SCB_DEMCR | 0x01000000;
*DWT_CONTROL = *DWT_CONTROL | 1 ; // enable the counter
#endif /* DEBUG_DWT */
if(getProgramVector()->checksum != sizeof(ProgramVector)) {
getProgramVector()->error = CHECKSUM_ERROR_STATUS;
getProgramVector()->message = (char*)"ProgramVector checksum error";
getProgramVector()->programStatus(AUDIO_ERROR_STATUS);
return -1;
}
if(getProgramVector()->audio_blocksize <= 0 ||
getProgramVector()->audio_blocksize > AUDIO_MAX_BLOCK_SIZE) {
getProgramVector()->error = CONFIGURATION_ERROR_STATUS;
getProgramVector()->message = (char*)"Invalid blocksize";
getProgramVector()->programStatus(AUDIO_ERROR_STATUS);
return -1;
}
setup();
#ifdef DEBUG_MEM
struct mallinfo minfo = mallinfo();
// getProgramVector()->heap_bytes_used = minfo.uordblks;
getProgramVector()->heap_bytes_used = minfo.arena;
#endif /* DEBUG_MEM */
for(;;) {
getProgramVector()->programReady();
#ifdef DEBUG_DWT
*DWT_CYCCNT = 0; // reset the counter
#endif /* DEBUG_DWT */
processBlock();
#ifdef DEBUG_DWT
getProgramVector()->cycles_per_block = *DWT_CYCCNT;
#endif /* DEBUG_DWT */
}
}
开发者ID:smrq,项目名称:OwlProgram,代码行数:49,代码来源:main.cpp
示例15: processQuery
void processQuery(struct blastQuery *bq, unsigned flags, FILE* pslFh, FILE* scoreFh)
/* process one query. Each gaped block becomes an psl. Chaining is left
* to other programs. Only output last round from PSI BLAST */
{
struct blastGappedAli* ba;
struct blastBlock *bb;
for (ba = bq->gapped; ba != NULL; ba = ba->next)
{
if (ba->psiRound == bq->psiRounds)
{
for (bb = ba->blocks; bb != NULL; bb = bb->next)
processBlock(bb, flags, pslFh, scoreFh);
}
}
}
开发者ID:apmagalhaes,项目名称:kentUtils,代码行数:15,代码来源:blastToPsl.c
示例16: while
/// process everything left in the internal buffer
void Keccak::processBuffer()
{
unsigned int blockSize = 200 - 2 * (m_bits / 8);
// add padding
size_t offset = m_bufferSize;
// add a "1" byte
m_buffer[offset++] = 1;
// fill with zeros
while (offset < blockSize)
m_buffer[offset++] = 0;
// and add a single set bit
m_buffer[blockSize - 1] |= 0x80;
processBlock(m_buffer);
}
开发者ID:AIS-Bonn,项目名称:humanoid_op_ros,代码行数:18,代码来源:keccak.cpp
示例17: processFrame
void XmlWriter::processTableCell(QDomElement &parent, const QTextTableCell &cell)
{
QDomElement element = document->createElement("cell");
element.setAttribute("row", cell.row());
element.setAttribute("column", cell.column());
QTextFrame::iterator it;
for (it = cell.begin(); !(it.atEnd()); ++it) {
QTextFrame *childFrame = it.currentFrame();
QTextBlock childBlock = it.currentBlock();
if (childFrame)
processFrame(element, childFrame);
else if (childBlock.isValid())
processBlock(element, childBlock);
}
parent.appendChild(element);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:19,代码来源:xmlwriter.cpp
示例18: IrredundantMatrix
void InputMatrix::calculate(IrredundantMatrix &irredundantMatrix) {
#ifdef DIFFERENT_MATRICES
IrredundantMatrix matrixForThread IrredundantMatrix(getFeatureWidth());
auto currentMatrix = &matrixForThread;
#else
auto currentMatrix = &irredundantMatrix;
#endif
for(size_t i=0; i<_r2Indexes.size()-1; ++i) {
for(size_t j=i+1; j<_r2Indexes.size(); ++j) {
#ifdef DIFFERENT_MATRICES
matrixForThread.clear()
#endif
processBlock(*currentMatrix, _r2Indexes[i], _r2Counts[i], _r2Indexes[j], _r2Counts[j]);
#ifdef DIFFERENT_MATRICES
irredundantMatrix.addMatrixConcurrent(std::move(matrixForThread));
#endif
}
}
}
开发者ID:zZLOiz,项目名称:multithread_test_construction,代码行数:22,代码来源:input_matrix.cpp
示例19: QDomDocument
QDomDocument *XmlWriter::toXml()
{
QDomImplementation implementation;
QDomDocumentType docType = implementation.createDocumentType(
"scribe-document", "scribe", "qt.nokia.com/scribe");
document = new QDomDocument(docType);
// ### This processing instruction is required to ensure that any kind
// of encoding is given when the document is written.
QDomProcessingInstruction process = document->createProcessingInstruction(
"xml", "version=\"1.0\" encoding=\"utf-8\"");
document->appendChild(process);
QDomElement documentElement = document->createElement("document");
document->appendChild(documentElement);
//! [0]
QTextBlock currentBlock = textDocument->begin();
while (currentBlock.isValid()) {
//! [0]
QDomElement blockElement = document->createElement("block");
document->appendChild(blockElement);
readFragment(currentBlock, blockElement, document);
//! [1]
processBlock(currentBlock);
//! [1]
//! [2]
currentBlock = currentBlock.next();
}
//! [2]
return document;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:38,代码来源:xmlwriter.cpp
示例20: while
QString TextDocumentSerializer::processFrame(QTextFrame *frame)
{
QString text;
QTextFrame::iterator it = frame->begin();
while(!it.atEnd()){
QTextFrame *childFrame = it.currentFrame();
QTextBlock childBlock = it.currentBlock();
if(childFrame)
text += processFrame(childFrame);
else if(childBlock.isValid()){
if(childBlock.textList())
text = removeTrailingLineBreaks(text);
text += processBlock(childBlock, it);
}
++it;
}
text = removeTrailingLineBreaks(text);
return text;
}
开发者ID:atilm,项目名称:RequirementsManager,代码行数:24,代码来源:textdocumentserializer.cpp
注:本文中的processBlock函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论