本文整理汇总了C++中PtrLList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ PtrLList::append方法的具体用法?C++ PtrLList::append怎么用?C++ PtrLList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PtrLList
的用法示例。
在下文中一共展示了PtrLList::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addEvent
/**
* Add an event.
*/
int Cron::addEvent (Event *e)
{
e->_id = getId ();
PtrLList<Cron::Event> *pEventList = (PtrLList<Cron::Event>*) _pEventList;
pEventList->append (e);
return e->_id;
}
示例2: br
//.........这里部分代码省略.........
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"failed to read BMP image after converting JPEG2000 to BMP; rc = %d\n", rc);
delete pBMPImage;
delete pReader;
return NULL;
}
delete pReader;
#endif
}
else if (inputObjectType == Chunker::PNG) {
#if defined (ANDROID)
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"JPEG2000 not supported on the Android platform\n");
return NULL;
#else
pBMPImage = PNGLibWrapper::convertPNGToBMP (pBuf, ui32Len);
if (pBMPImage == NULL) {
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"failed to convert PNG image to BMP\n");
return NULL;
}
#endif
}
else {
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"unsupported input type %d\n", (int) inputObjectType);
return NULL;
}
PtrLList<Fragment> *pFragments = new PtrLList<Fragment>;
for (uint8 ui8CurrentChunk = 1; ui8CurrentChunk <= ui8NoOfChunks; ui8CurrentChunk++) {
BMPImage *pBMPChunk = BMPChunker::fragmentBMP (pBMPImage, ui8CurrentChunk, ui8NoOfChunks);
if (pBMPChunk == NULL) {
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"failed to fragment BMP to create chunk %d of %d\n", (int) ui8CurrentChunk, (int) ui8NoOfChunks);
delete pFragments;
return NULL;
}
int rc;
Fragment *pFragment = new Fragment();
pFragment->src_type = inputObjectType;
if (outputChunkType == Chunker::BMP) {
BufferWriter bw (pBMPChunk->getTotalSize(), 1024);
if (0 != (rc = pBMPChunk->writeHeaderAndImage (&bw))) {
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"failed to write chunk BMP into buffer; rc = %d\n", rc);
delete pFragments;
return NULL;
}
uint32 ui32ChunkLen = bw.getBufferLength();
pFragment->pReader = new BufferReader (bw.relinquishBuffer(), ui32ChunkLen, true);
pFragment->ui64FragLen = ui32ChunkLen;
}
else if (outputChunkType == Chunker::JPEG) {
BufferReader *pReader = JPEGLibWrapper::convertBMPToJPEG (pBMPChunk, ui8ChunkCompressionQuality);
if (pReader == NULL) {
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"failed to encode BMP chunk into JPEG\n");
delete pFragments;
return NULL;
}
pFragment->pReader = pReader;
pFragment->ui64FragLen = pReader->getBytesAvailable();
}
else if (outputChunkType == Chunker::JPEG2000) {
#if defined (ANDROID)
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"JPEG2000 not supported on the Android platform\n");
delete pFragments;
return NULL;
#else
BufferWriter bw (pBMPChunk->getTotalSize(), 1024);
if (0 != (rc = pBMPChunk->writeHeaderAndImage (&bw))) {
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"failed to write chunk BMP into buffer for creating JPEG2000; rc = %d\n", rc);
delete pFragments;
return NULL;
}
BufferReader *pReader = JasperWrapper::convertToJPEG2000 (bw.getBuffer(), bw.getBufferLength());
if (pReader == NULL) {
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"failed to encode BMP chunk into JPEG2000\n");
delete pFragments;
return NULL;
}
pFragment->pReader = pReader;
pFragment->ui64FragLen = pReader->getBytesAvailable();
#endif
}
else {
checkAndLogMsg ("Chunker::fragmentBuffer", Logger::L_MildError,
"unsupported output type %d\n", (int) outputChunkType);
return NULL;
}
pFragment->out_type = outputChunkType;
pFragment->ui8Part = ui8CurrentChunk;
pFragment->ui8TotParts = ui8NoOfChunks;
pFragments->append (pFragment);
}
return pFragments;
}