24 #include "common_priv.h"
33 :
QueueBase(k, attr), queue(0), oldqueue(0), enqueueUseOld(false), dequeueUseOld(false)
41 unsigned length,
bool usembs)
42 :
QueueBase(k, attr), queue(0), oldqueue(0), enqueueUseOld(false), dequeueUseOld(false)
83 memcpy(dst,src,count);
225 auto_ptr<TQImpl> oldQueue = auto_ptr<TQImpl>(
new TQImpl(*
this));
228 ulong oldhead = head;
229 ulong oldtail = tail;
232 AllocateBuf(queueLen,maxThresh,numChannels,mbs?1:0);
239 while ( (count = oldQueue->
Count()) != 0 ) {
243 for (
ulong chan = 0; chan < numChannels; chan++) {
247 memcpy(dst, src, count*elementSize);
256 oldQueue->
head = oldhead;
257 oldQueue->
tail = oldtail;
260 return oldQueue.release();
unsigned GetLength() const
ThresholdQueue(KernelBase *k, const SimpleQueueAttr &attr, bool usembs)
virtual void UnlockedGrow(unsigned queueLen, unsigned maxThresh)
unsigned QueueLength() const
virtual void InternalDequeue(unsigned count)
virtual unsigned UnlockedMaxThreshold() const
unsigned GetNumChannels() const
void * GetRawEnqueuePtr(unsigned thresh, unsigned chan)
virtual unsigned UnlockedDequeueChannelStride() const
Definition of the queue attributes.
virtual void * InternalGetRawEnqueuePtr(unsigned thresh, unsigned chan)
ThresholdQueueBase::ulong ulong
void Dequeue(ulong count)
ulong MaxThreshold(void) const
virtual unsigned UnlockedQueueLength() const
const void * GetRawDequeuePtr(ulong dequeueThresh, ulong chan=0) const
The base class for all queues in the CPN library.
ulong NumChannels(void) const
unsigned MaxThreshold() const
virtual void InternalReset()
ulong QueueLength(void) const
TQImpl(unsigned length, unsigned maxthres, unsigned numchan)
unsigned GetMaxThreshold() const
ulong ElementsDequeued(void) const
unsigned UnlockedNumDequeued() const
ulong Freespace(void) const
void Enqueue(unsigned count)
ulong ChannelStride(void) const
void Enqueue(ulong count)
virtual bool UnlockedFull() const
ulong ElementsEnqueued(void) const
virtual void InternalEnqueue(unsigned count)
virtual unsigned UnlockedNumChannels() const
virtual unsigned UnlockedFreespace() const
Default threshold queue implementation.
virtual const void * InternalGetRawDequeuePtr(unsigned thresh, unsigned chan)
virtual unsigned UnlockedEnqueueChannelStride() const
virtual unsigned UnlockedCount() const
TQImpl * Grow(unsigned queueLen, unsigned maxThresh, bool copy)
virtual void InternalReset()
void * GetRawEnqueuePtr(ulong enqueueThresh, ulong chan=0) const
unsigned UnlockedNumEnqueued() const
virtual bool UnlockedEmpty() const
This is a simplified internal representation of the queue attributes needed to create a queue...