29 char* ManagedBuffer::calcAddressPtr(
char* pBufferPtr,
int pSlotId)
const {
33 sizeof(int)*aSlotQty +
41 void ManagedBuffer::cleanSlot(
char* pBufferPtr,
int pSlotId) {
42 char* vSlotPtr = calcAddressPtr(pBufferPtr,pSlotId);
43 memset(vSlotPtr,0,aSlotSize);
47 void ManagedBuffer::pushFree(
char* pSharedBufferPtr,
int pSlotId) {
55 if (aLastFreeSlot != (aSlotQty-1)) {
57 int* vQueueHeadPtr = (
int*)pSharedBufferPtr;
58 vQueueHeadPtr[aLastFreeSlot] = pSlotId;
63 int ManagedBuffer::popFree(
char* pSharedBufferPtr) {
69 if (aLastFreeSlot >= 0) {
70 int* vQueueHeadPtr = (
int*)pSharedBufferPtr;
71 vResult = vQueueHeadPtr[aLastFreeSlot];
79 const char* ManagedBuffer::dataPtr(
char* pSharedBufferPtr)
const {
81 return pSharedBufferPtr+(aSlotQty*
sizeof(int));
85 size_t ManagedBuffer::dataSize()
const {
87 return (aSlotQty*
sizeof(
int) + (aSlotQty*aSlotSize));
92 int ManagedBuffer::wait() {
97 vResult = aSignaledSlot;
104 void ManagedBuffer::signal(
int pSlotId) {
106 aSignaledSlot = pSlotId;