本文整理汇总了C++中Queue函数的典型用法代码示例。如果您正苦于以下问题:C++ Queue函数的具体用法?C++ Queue怎么用?C++ Queue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Queue函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Flush
HRESULT CStreamParser::Parse(const GUID &gSubtype, Packet *pPacket)
{
if (gSubtype != m_gSubtype) {
m_gSubtype = gSubtype;
Flush();
}
if (!pPacket || (pPacket->dwFlags & LAV_PACKET_PARSED)) {
Queue(pPacket);
} else if (m_gSubtype == MEDIASUBTYPE_AVC1 && (m_strContainer == "mpegts" || pPacket->dwFlags & LAV_PACKET_H264_ANNEXB)) {
ParseH264AnnexB(pPacket);
} else if (m_gSubtype == MEDIASUBTYPE_HDMVSUB) {
ParsePGS(pPacket);
} else if (m_gSubtype == MEDIASUBTYPE_HDMV_LPCM_AUDIO) {
pPacket->RemoveHead(4);
Queue(pPacket);
} else if (pPacket->dwFlags & LAV_PACKET_MOV_TEXT) {
ParseMOVText(pPacket);
} else if (m_strContainer == "avi" && m_gSubtype == MEDIASUBTYPE_ASS) {
ParseRawSSA(pPacket);
} else if (m_gSubtype == MEDIASUBTYPE_AAC && (m_strContainer != "matroska" && m_strContainer != "mp4")) {
ParseAAC(pPacket);
} else if (m_gSubtype == MEDIASUBTYPE_UTF8 && (pPacket->dwFlags & LAV_PACKET_SRT)) {
ParseSRT(pPacket);
} else {
Queue(pPacket);
}
return S_OK;
}
开发者ID:cynics,项目名称:LAVFilters,代码行数:30,代码来源:StreamParser.cpp
示例2: Queue
bool FCircularQueueTest::RunTest( const FString& Parameters )
{
const uint32 QueueSize = 8;
// empty queue
{
TCircularQueue<int32> Queue(QueueSize);
TestTrue(TEXT("Newly created queues must be empty"), Queue.IsEmpty());
TestFalse(TEXT("Newly created queues must not be full"), Queue.IsFull());
}
// partially filled
{
TCircularQueue<int32> Queue(QueueSize);
int32 Value;
TestTrue(TEXT("Adding to an empty queue must succeed"), Queue.Enqueue(666));
TestFalse(TEXT("Partially filled queues must not be empty"), Queue.IsEmpty());
TestFalse(TEXT("Partially filled queues must not be full"), Queue.IsFull());
TestTrue(TEXT("Peeking at a partially filled queue must succeed"), Queue.Peek(Value));
}
// full queue
{
TCircularQueue<int32> Queue(QueueSize);
for (int32 Index = 0; Index < QueueSize - 1; ++Index)
{
TestTrue(TEXT("Adding to non-full queue must succeed"), Queue.Enqueue(Index));
}
TestFalse(TEXT("Full queues must not be empty"), Queue.IsEmpty());
TestTrue(TEXT("Full queues must be full"), Queue.IsFull());
TestFalse(TEXT("Adding to full queue must fail"), Queue.Enqueue(666));
int32 Value;
for (int32 Index = 0; Index < QueueSize - 1; ++Index)
{
TestTrue(TEXT("Peeking at a none-empty queue must succeed"), Queue.Peek(Value));
TestEqual(TEXT("The peeked at value must be correct"), Value, Index);
TestTrue(TEXT("Removing from a non-empty queue must succeed"), Queue.Dequeue(Value));
TestEqual(TEXT("The removed value must be correct"), Value, Index);
}
TestTrue(TEXT("A queue that had all items removed must be empty"), Queue.IsEmpty());
TestFalse(TEXT("A queue that had all items removed must not be full"), Queue.IsFull());
}
return true;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:52,代码来源:CircularQueueTest.cpp
示例3: Queue
u64 RuntimeQueue::Queue(
ThreadId const& targetThread, RuntimeTask&& task, rqe& ec)
{
if(!VerifyTask(task, ec))
return 0;
if(task.flags & RuntimeTask::Periodic)
{
task.time = RuntimeTask::clock::now() + task.interval;
}
if(!context->globalMod.try_lock())
{
ec = RQE::ShuttingDown;
return 0;
}
auto thread_id = targetThread.hash();
auto q_it = context->queues.find(thread_id);
if(q_it == context->queues.end())
{
context->globalMod.unlock();
ec = RQE::InvalidQueue;
return 0;
} else
{
context->globalMod.unlock();
return Queue(&q_it->second, std::move(task), ec);
}
}
开发者ID:hbirchtree,项目名称:coffeecutie,代码行数:31,代码来源:task.cpp
示例4: Queue
OsclReturnCode FillBufferDoneThreadSafeCallbackAOEnc::ReceiveEvent(OMX_OUT OMX_HANDLETYPE aComponent,
OMX_OUT OMX_PTR aAppData,
OMX_OUT OMX_BUFFERHEADERTYPE* aBuffer)
{
// Note: this method executes in the context of remote thread trying to make the callback
OsclReturnCode status;
OsclProcStatus::eOsclProcError sema_status;
// Wait on the remote thread control semaphore. If the queue is full, must block and wait
// for the AO to dequeue some previous event. If the queue is not full, proceed
sema_status = RemoteThreadCtrlSema.Wait();
if (sema_status != OsclProcStatus::SUCCESS_ERROR)
return OsclFailure;
// NOTE: the semaphore will prevent the mempool allocate to be used if the queue is full
// allocate the memory for the callback event specific data
FillBufferDoneSpecificData* ED = (FillBufferDoneSpecificData*) iMemoryPool->allocate(sizeof(FillBufferDoneSpecificData));
// pack the relevant data into the structure
ED->hComponent = aComponent;
ED->pAppData = aAppData;
ED->pBuffer = aBuffer;
// convert the pointer into OsclAny ptr
OsclAny* P = (OsclAny*) ED;
// now , queue the event pointer
status = Queue(P);
return status;
}
开发者ID:Andproject,项目名称:platform_external_opencore,代码行数:32,代码来源:pvmf_omx_enc_callbacks.cpp
示例5: LOG_COMMANDS
// Delete all in folder, then folder itself
void CImImap4Compound::DeleteFolderL(TRequestStatus& aStatus, const TMsvId aSource)
{
LOG_COMMANDS((iSession->LogText(_L8("COMPOUND DeleteFolder(%x)"),aSource)));
Queue(aStatus);
// Save parameters
iSourceFolder=aSource;
iSequence=SeqDeleteFolder;
// The folder might be a mailbox (in which case it needs selecting, messages
// deleting, closing, then deletion of the folder) or it might be a \Noselect
// folder, which we just delete.
User::LeaveIfError(iEntry->SetEntry(aSource));
TMsvEmailEntry folder=iEntry->Entry();
if (!folder.Mailbox())
{
DBG((iSession->LogText(_L8("Folder is marked \\NoSelect: just delete it"))));
// Skip the first few steps
iStep=2;
}
else
{
DBG((iSession->LogText(_L8("Folder is a mailbox: deleting messages and folder"))));
// Start from folder selection
iStep=0;
}
DoRunL();
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:33,代码来源:IMAPCOMP.CPP
示例6: DBG
void CImImap4Compound::GenericCopyL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination, TInt* aSequence)
{
DBG((iSession->LogText(_L8("CImImap4Compound::GenericCopyL()"))));
Queue(aStatus);
// Save parameters
iSource=aSourceSel[0];
delete iSourceSel;
iSourceSel = NULL;
iSourceSel=aSourceSel.CopyL();
iDestinationFolder=aDestination;
iMessageSelection=iSelectionStillToCopy=iSelectionStillToDelete=aSourceSel.Count();
// Check that selection elements are contiguous. Just call Copy on contiguous selections.
iSourceFolder=FindFolderL((*iSourceSel)[iSelectionStillToCopy-1]);
// Find the offending source folder
if (iSourceFolder == NULL &&
aSequence != SeqMoveFromLocal && aSequence != SeqCopyFromLocal)
{
Complete(KErrNotFound);
return;
}
// Select it
iStep=0;
iSequence=aSequence;
DoRunL();
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:30,代码来源:IMAPCOMP.CPP
示例7: Queue
void CCmdUndertaker::RunL()
{
TInt handle = iDeadThreadHandle;
Queue(); // Queue early, to try and avoid missing notifications
// We don't use the RunL if we're in paranoid mode - the undertaker notifications are serviced directly in DoWork() without an active scheduler
ProcessHandle(handle);
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:7,代码来源:undertaker.cpp
示例8: __LOG_TEXT
/**
Resumes the operation following a migration.
*/
void CImapCompoundDeleteFolder::ResumeOperationL(TRequestStatus& aStatus, CImapSession& aSession)
{
iSession = &aSession;
__LOG_TEXT(iSession->LogId(), "CImapCompoundDeleteFolder::Resuming");
__ASSERT_DEBUG(iCurrentStep==ESuspendedForMigrate, TImapServerPanic::ImapPanic(TImapServerPanic::EDeleteCompoundUnexpectedState));
iStopForMigrate = EFalse;
// Switch on next step - some "next steps" require a SELEECT first...
switch (iNextStep)
{
case ESelectSourceMailboxRW:
case EDeleteFolder:
{
// just return to the main state machine
CompleteSelf();
break;
}
case EDeleteAllMessages:
case ECloseFolder:
case EDeleteLocalFolder:
case EFinished:
// not expected
default:
{
__ASSERT_DEBUG(EFalse, TImapServerPanic::ImapPanic(TImapServerPanic::EDeleteCompoundUnexpectedState));
// abandon the compound operation
iNextStep=EFinished;
CompleteSelf();
break;
}
}
Queue(aStatus);
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:37,代码来源:cimapcompounddeletefolder.cpp
示例9: OstTraceDef0
void CSmsMessageSend::Start(CSmsMessage& aSmsMessage, TInt aOptions,
const TSmsAddr& aSmsAddr, TRequestStatus& aStatus)
{
OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSMESSAGESEND_START_1, "CSmsMessageSend::Start()");
__ASSERT_DEBUG(iState == ESmsMessageSendIdle,SmspPanic(KSmspPanicUnexpectedState));
//
// Store the request status that we will complete when finished...
//
Queue(aStatus);
//
// Initialise member data...
//
iSmsMessage=&aSmsMessage;
iSmsMessage->ParsedToFromAddress(iToFromTelNumber);
iOptions = aOptions;
iSmsAddr = aSmsAddr;
iSmsPDUData.iType = aSmsMessage.Type();
iSmsPDUData.iTotal = 0;
iSmsPDUData.iSent = 0;
iSmsPDUData.iDelivered = 0;
iSendError = KErrNone;
iSmsEventLogger->Event().SetId(KLogNullId);
//
// Begin by setting the bearer...
//
iState = ESmsMessageSendSetBearer;
iSmspSetBearer.NotifyBearerSet(iStatus);
SetActive();
} // CSmsMessageSend::Start
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:35,代码来源:smspsend.cpp
示例10: while
Queue<T>& Queue<T>::operator=(const Queue<T>& other)
{
Node * nodePointer = head;
Node * tempPointer = 0;
while (nodePointer)
{
tempPointer = nodePointer;
nodePointer = nodePointer->next;
delete tempPointer;
}
head = 0;
if (!other.head)
{
Queue();
return *this;
}
else
{
Node * otherPointer = other.head;
while (otherPointer)
{
enqueue(otherPointer->element);
otherPointer = otherPointer->next;
}
}
return *this;
}
开发者ID:Regan-Koopmans,项目名称:ProjectApricot,代码行数:31,代码来源:Queue.C
示例11: QuitSession
/**
Deletes a session.
@param aSession The session to delete. This routine takes immediate ownsership
of the session.
@param aClientStatus Signals completion of the request
*/
void CPopSessionManager::DeleteSession(CImPop3Session& aSession,
TRequestStatus& aClientStatus)
{
iSession = &aSession;
QuitSession();
Queue(aClientStatus);
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:14,代码来源:cpopsessionmanager.cpp
示例12: __LOG_TEXT
void CImapCompoundDelete::StartOperation(TRequestStatus& aStatus, CImapSession& aSession)
{
iSession = &aSession;
__LOG_TEXT(iSession->LogId(), "CImapCompoundDelete::StartOperation()");
iNextStep = ESelectSourceMailboxRW;
Queue(aStatus);
CompleteSelf();
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:8,代码来源:cimapcompounddelete.cpp
示例13: Queue
void CSvgtRasterizerOOMPropertyMonitor::ConstructL()
{
if (CActiveScheduler::Current())
{
User::LeaveIfError(iOomWatcher.Attach(KSvgtPropertyCategory, ESvgtPropertyBool));
Queue();
}
}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:9,代码来源:SvgtRasterizerOOMPropertyMonitor.cpp
示例14: msg
void Lurker::ShowYesNo(const std::string& q, const Colour& fgCol, const Colour& bgCol,
CommandFunc no, CommandFunc yes)
{
LurkMsg msg(q, fgCol, bgCol,AMJU_CENTRE, 0);
msg.SetNoCommand(no);
msg.SetYesCommand(yes);
Queue(msg);
}
开发者ID:jason-amju,项目名称:amjulib,代码行数:9,代码来源:LurkMsg.cpp
示例15: Queue
void CImapOpSyncSubs::SynchroniseSubscriptionsL(TRequestStatus& aStatus)
{
// Do we need to know what folders are subscribed remotely?
if (iImapSettings.Synchronise() == EUseLocal &&
(iImapSettings.Subscribe() == EUpdateNeither || iImapSettings.Subscribe() == EUpdateLocal))
{
// Just update any remote subscriptions
iNextSyncAction = CImapSyncManager::EUpdateRemoteSubscription;
Queue(aStatus);
CompleteSelf();
SetActive();
}
else
{
// Update our list of remotely subscribed folders
// First, we need to go through the entire service, resetting all
// the 'remote subscribed' flags.
ResetSubscriptionFlagsL(iServiceId);
// Build a buffer to quote the folder path (it may be necessary)
HBufC16* path=HBufC16::NewLC(iImapSettings.FolderPath().Length()+2);
path->Des().Copy(iImapSettings.FolderPath());
if (iImapSettings.FolderPath().Length())
{
path->Des().Append(iImapSettings.PathSeparator());
}
path->Des().Append(KStarChar);
// Quote it
CImapFolder::DoQuoteL(path);
// List this tree
iNextSyncAction = CImapSyncManager::EProcessRemoteSubscription;
iServerEntry.SetEntry(iServiceId);
TMsvEmailEntry entry = iServerEntry.Entry();
iSession.LsubL(iStatus, KNullDesC, path->Des(), iImapListFolderInfo);
Queue(aStatus);
SetActive();
CleanupStack::PopAndDestroy(path);
}
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:44,代码来源:cimapopsyncsubs.cpp
示例16: Queue
void CTestActive::RunL()
{
Queue();
switch (iState++)
{
case 0:
test.Next(_L("Extended error"));
CBaActiveScheduler::DisplayExtendedError(KUidTest,66);
test.Next(_L("Leave for alert"));
CBaActiveScheduler::LeaveForAlert(KUidBaflDll,77);
CBaActiveScheduler::DisplayExtendedError(KUidTest,88); // won't reach here
break;
case 1:
test.Next(_L("Leave"));
User::Leave(-22);
CBaActiveScheduler::DisplayExtendedError(KUidBaflDll,9); // won't reach here
break;
case 2:
test.Next(_L("Leave no alert"));
CBaActiveScheduler::LeaveNoAlert();
CBaActiveScheduler::DisplayExtendedError(KUidTest,55); // won't reach here
break;
case 3:
test.Next(_L("Extended error again"));
CBaActiveScheduler::DisplayExtendedError(KUidBaflDll,33);
test.Next(_L("Leave for info print"));
CBaActiveScheduler::LeaveForInfoPrint(KUidTest,11);
CBaActiveScheduler::DisplayExtendedError(KUidBaflDll,88); // won't reach here
break;
case 4:
test.Next(_L("Simple error handler"));
CBaActiveScheduler::LeaveForErrorHandler(&iSimpleErrorHandler);
CBaActiveScheduler::DisplayExtendedError(KUidBaflDll,87); // won't reach here
break;
case 5:
test.Next(_L("Complex error handler - 1"));
CBaActiveScheduler::LeaveForErrorHandler(&iComplexErrorHandler);
CBaActiveScheduler::DisplayExtendedError(KUidBaflDll,86); // won't reach here
break;
case 6:
test.Next(_L("Complex error handler - 2"));
iComplexErrorHandler.SetState(6);
CBaActiveScheduler::LeaveForErrorHandler(&iComplexErrorHandler);
CBaActiveScheduler::DisplayExtendedError(KUidBaflDll,85); // won't reach here
break;
case 7:
test.Next(_L("Exit"));
CBaActiveScheduler::Exit();
CBaActiveScheduler::DisplayExtendedError(KUidBaflDll,99); // won't reach here
break;
case 8:
CBaActiveScheduler::DisplayExtendedError(KUidBaflDll,999); // won't reach here
break;
}
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:55,代码来源:T_SCHED.CPP
示例17: OstTraceDef0
/**
* Gets the specified event from the log.
*
* The event itself can be obtained using a subsequent call to Event().
*
* @param aStatus Asynchronous status word to signal when the operation is complete
* @param aId Log event ID for the event
* @capability ReadUserData
*/
EXPORT_C void CSmsEventLogger::GetEvent(TRequestStatus& aStatus,TLogId aId)
{
OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSEVENTLOGGER_GETEVENT_1, "CSmsEventLogger::GetEvent");
__ASSERT_DEBUG(iState==ESmsEventLoggerIdle,SmsuPanic(KSmsuPanicUnexpectedState));
iState=ESmsEventLoggerGettingEvent;
Queue(aStatus);
iLogEvent->SetId(aId);
iLogWrapper->Log().GetEvent(*iLogEvent,iStatus);
SetActive();
} // CSmsEventLogger::GetEvent
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:20,代码来源:smsulog.cpp
示例18: OstTraceDef0
/**
* Starts CSmsPDUDelete active object
* Calls private methd OpenStore
*
* @param aStatus Reguest status
* @param aStoreIndex Index to the store to be read
*/
void CSmsPDUDelete::Start(CArrayFix<TGsmSmsSlotEntry>& aLocationArray, TRequestStatus& aStatus)
{
OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPDUDELETE_START_1, "CSmsPDUDelete::Start()");
__ASSERT_DEBUG(iState==ESmsPDUDeleteIdle,SmspPanic(KSmspPanicUnexpectedState));
Queue(aStatus);
iLocationArray=&aLocationArray;
iState=ESmsPDUDeleteOpeningStore;
OpenStore();
} // CSmsPDUDelete::Start
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:19,代码来源:smspdel.cpp
示例19: CreateConnectionL
/**
Gets a new logged in POP session.
The caller passes a reference to a session pointer which they should initially
set to NULL. If the client status is completed with KErrNone, then their pointer
will have been updated to point to the new session. If the client status completes
with an error then their pointer will not be updated.
@param aSettings POP settings
@param aIAPPrefs IAP preferences
@param aSession Used to store session to pass back to caller
@param aClientStatus Signals completion of the request
*/
void CPopSessionManager::GetSessionL(CImPop3Settings& aSettings,
CImIAPPreferences& aIAPPrefs,
CImPop3Session*& aSession,
TRequestStatus& aClientStatus)
{
iSettings = &aSettings;
iIAPPrefs = &aIAPPrefs;
iStoreSession = &aSession;
CreateConnectionL();
Queue(aClientStatus);
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:25,代码来源:cpopsessionmanager.cpp
示例20: main
int main(int argc, char *argv[]) {
DATA_TYPE *A;
DATA_TYPE *B_outputFromGpu;
/////////////////////////
size_t oldSizes[2] = { NI, NJ };
size_t newSizes[2];
getNewSizes(oldSizes, NULL, newSizes, NULL, "Convolution2D_kernel", 2);
NI = newSizes[0];
NJ = newSizes[1];
/////////////////////////
A = (DATA_TYPE *)malloc(NI * NJ * sizeof(DATA_TYPE));
B_outputFromGpu = (DATA_TYPE *)malloc(NI * NJ * sizeof(DATA_TYPE));
init(A);
platform = new Platform(PLATFORM_ID);
context = platform->getContext();
Device device = platform->getDevice(DEVICE_ID);
Queue queue = Queue(*context,device,Queue::EnableProfiling);
cl_mem_init(A,queue);
SourceFile kernelFile = KERNEL_DIRECTORY KERNEL_FILE_NAME;
// Create a program from the kernel source
Program program(context,kernelFile);
if(!program.build(device)) {
std::cout << "Error building the program: " << "\n";
std::cout << program.getBuildLog(device) << "\n";
return 1;
}
// Create the OpenCL kernel
kernel = program.createKernel(kernelName.c_str());
cl_launch_kernel(queue);
queue.readBuffer(*b_mem_obj,NI * NJ * sizeof(DATA_TYPE),(void*) B_outputFromGpu);
queue.finish();
conv2D(A, B_outputFromGpu);
free(A);
free(B_outputFromGpu);
cl_clean_up();
return 0;
}
开发者ID:EwanC,项目名称:OCL_Visualiser,代码行数:50,代码来源:2DConvolution.cpp
注:本文中的Queue函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论