29#ifndef PX_REPORT_CALLBACK_H
30#define PX_REPORT_CALLBACK_H
36#include "common/PxPhysXCommonConfig.h"
37#include "foundation/PxArray.h"
62 PxReportCallback(T* buffer=NULL, PxU32 capacity=0) : mBuffer(buffer), mCapacity(capacity),
mSize(0) {}
103 PX_ASSERT(capacity<=256);
104 this->mCapacity = capacity;
109 PX_ASSERT(nbItems<=this->mCapacity);
110 PX_ASSERT(items==this->mBuffer);
137 template<
class T, const PxU32 capacityT>
140 T mLocalStorage[capacityT];
145 this->mBuffer = mLocalStorage;
146 this->mCapacity = capacityT;
151 PX_ASSERT(items==mLocalStorage);
152 PX_ASSERT(nbItems<=this->mCapacity);
190 this->mBuffer = buffer;
191 this->mCapacity = capacity;
196 PX_ASSERT(items==this->mBuffer);
197 PX_ASSERT(nbItems<=this->mCapacity);
229 mResults.reserve(32);
230 this->mBuffer = mResults.begin();
231 this->mCapacity = mResults.capacity();
236 const PxU32 size = mResults.size();
237 const PxU32 capa = mResults.capacity();
238 const PxU32 newSize = size+nbItems;
239 PX_ASSERT(newSize<=capa);
240 mResults.forceSize_Unsafe(newSize);
243 const PxU32 newCapa = capa*2;
244 mResults.reserve(newCapa);
245 this->mBuffer = mResults.begin() + newSize;
246 this->mCapacity = mResults.capacity() - newSize;
Dynamic array report callback.
Definition PxReportCallback.h:225
virtual bool flushResults(PxU32 nbItems, const T *)
Reports query results to users.
Definition PxReportCallback.h:234
External storage report callback.
Definition PxReportCallback.h:186
virtual bool processResults(PxU32 nbItems, const T *items)=0
Reports query results to users.
virtual bool flushResults(PxU32 nbItems, const T *items)
Reports query results to users.
Definition PxReportCallback.h:194
Local storage report callback.
Definition PxReportCallback.h:139
virtual bool flushResults(PxU32 nbItems, const T *items)
Reports query results to users.
Definition PxReportCallback.h:149
virtual bool processResults(PxU32 nbItems, const T *items)=0
Reports query results to users.
Regular report callback.
Definition PxReportCallback.h:99
virtual bool processResults(PxU32 nbItems, const T *items)=0
Reports query results to users.
virtual bool flushResults(PxU32 nbItems, const T *items)
Reports query results to users.
Definition PxReportCallback.h:107
Base class for callback reporting an unknown number of items to users.
Definition PxReportCallback.h:60
PxU32 mSize
Current number of items in the buffer. This is entirely managed by the system.
Definition PxReportCallback.h:68
virtual bool flushResults(PxU32 nbItems, const T *items)=0
Reports query results to users.
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39