Documentation Project 1
ContentsIndexHome
PreviousUpNext
sack::containers::DataQueue Structure
C++
struct DataQueue {
  _32 Top;
  _32 Bottom;
  _32 Cnt;
  _32 Lock;
  _32 Size;
  _32 ExpandBy;
  _8 data[1];
};
Members 
Description 
_32 Top; 
This is the next index to be added to. If Top==Bottom, the queue is empty, until an entry is added at Top, and Top increments. 
_32 Bottom; 
The current bottom index. This is the next one to be returned. 
_32 Cnt; 
How many elements the queue can hold. If a queue has more elements added to it than it has count, it will be expanded, and a new queue returned. 
_32 Lock; 
thread interlock using InterlockedExchange semaphore 
_32 Size; 
How big each element in the queue is. 
_32 ExpandBy; 
How many elements to expand the queue by, when its capacity is reached. 
_8 data[1]; 
The data area of the queue

A queue of structure elements.

The size of each element must be known at stack creation time. Structures are literally copied to and from this stack. This is a stack 'by value'. When extended, the stack will occupy different memory, care must be taken to not duplicate pointers to this stack.

Copyright (c) 2010. All rights reserved.
What do you think about this topic? Send feedback!