Documentation Project 1
sack::containers::data_queue::PeekDataQueueEx Function
__cdecl TYPELIB_PROC LOGICAL PeekDataQueueEx(PDATAQUEUE * pplq, POINTER ResultBuffer, INDEX idx);

get a PDATAQUEUE element at index result buffer is a pointer to the type of structure expected to be stored within this. The buffer result is a copy of the data stored in the queue. This enforces that data stored in the list is immutable. Also on the basic DequeData function, after resulting, if the pointer to the data within the queue were returned, it could become invalid immediatly after returning by having another enque happen which overwrites that position in the buffer. One could, in theory, set a flag in the queue that a deque was done, and not update the bottom until that flag is encountered while within DequeData again... the pointer to the data in the queue may also not be returned because the queue may be reallocated and moved.

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