QXRD
0.11.16
|
#include <qcepallocator.h>
Public Types | |
enum | AllocationStrategy { WaitTillAvailable, NullIfNotAvailable, AllocateFromReserve, AlwaysAllocate } |
enum | { MegaBytes = 0x100000 } |
Public Member Functions | |
QcepAllocator (QcepSettingsSaverPtr saver) | |
virtual | ~QcepAllocator () |
void | readSettings (QSettings *settings, QString section) |
void | writeSettings (QSettings *settings, QString section) |
int | int16SizeMB (int width, int height) |
int | int32SizeMB (int width, int height) |
int | doubleSizeMB (int width, int height) |
int | maskSizeMB (int width, int height) |
int | integratedSizeMB (int nrows) |
double | allocatedMemoryMB () |
double | maximumMemoryMB () |
double | maximumMemory () |
void | changedSizeMB (int newMB) |
QMutex * | mutex () |
Public Member Functions inherited from QcepObject | |
QcepObject (QString name, QcepObject *parent) | |
virtual | ~QcepObject () |
QString | get_Name () const |
void | set_Name (QString name) |
Static Public Member Functions | |
static QcepInt16ImageDataPtr | newInt16Image (AllocationStrategy strat, int width, int height, QcepObject *parent) |
static QcepInt32ImageDataPtr | newInt32Image (AllocationStrategy strat, int width, int height, QcepObject *parent) |
static QcepDoubleImageDataPtr | newDoubleImage (AllocationStrategy strat, int width, int height, QcepObject *parent) |
static QcepMaskDataPtr | newMask (AllocationStrategy strat, int width, int height, int def, QcepObject *parent) |
static QcepIntegratedDataPtr | newIntegratedData (AllocationStrategy strat, QcepDoubleImageDataPtr image, QcepObject *parent) |
static QcepDoubleImageDataPtr | newDoubleImage (QString name, int width, int height, QcepObject *parent) |
static QcepIntegratedDataPtr | newIntegratedData (QString name, int size, QcepObject *parent) |
static void | newDoubleImageAndIntegratedData (AllocationStrategy strat, int width, int height, QcepObject *parent, QcepDoubleImageDataPtr &img, QcepIntegratedDataPtr &integ) |
static void | allocate (int sz, int width, int height) |
static void | deallocate (int sz, int width, int height) |
static void | allocate (quint64 amt) |
static void | deallocate (quint64 amt) |
static quint64 | allocatedMemory () |
Static Public Member Functions inherited from QcepObject | |
static int | allocatedObjects () |
static int | deletedObjects () |
static QSet< QcepObject * > | allocatedObjectsSet () |
static QString | addSlashes (QString str) |
Protected Member Functions | |
void | allocateBytes (quint64 amt) |
void | deallocateBytes (quint64 amt) |
Properties | |
int | max |
int | totalBufferSizeMB32 |
int | totalBufferSizeMB64 |
int | reserve |
int | allocated |
Properties inherited from QcepObject | |
QString | name |
Private Slots | |
void | allocatorHeartbeat () |
Private Member Functions | |
int | waitTillAvailable (AllocationStrategy strat, int sizeMB) |
Private Attributes | |
QMutex | m_Mutex |
QTimer | m_Timer |
QAtomicInt | m_AllocatedMemoryMB |
Additional Inherited Members | |
Public Slots inherited from QcepObject | |
virtual void | printLine (QString line) |
virtual void | printMessage (QString msg, QDateTime dt=QDateTime::currentDateTime()) const |
virtual void | criticalMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const |
virtual void | statusMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) const |
virtual QString | settingsScript () |
QString | scriptValueLiteral (QVariant v) |
Definition at line 17 of file qcepallocator.h.
anonymous enum |
Enumerator | |
---|---|
WaitTillAvailable | |
NullIfNotAvailable | |
AllocateFromReserve | |
AlwaysAllocate |
Definition at line 30 of file qcepallocator.h.
QcepAllocator::QcepAllocator | ( | QcepSettingsSaverPtr | saver | ) |
Definition at line 15 of file qcepallocator.cpp.
References allocatorHeartbeat(), DEBUG_ALLOCATOR, DEBUG_CONSTRUCTORS, g_Application, HEXARG, m_Timer, QcepApplication::printMessage(), and qcepDebug().
|
virtual |
Definition at line 46 of file qcepallocator.cpp.
References DEBUG_ALLOCATOR, DEBUG_CONSTRUCTORS, g_Application, HEXARG, QcepApplication::printMessage(), and qcepDebug().
|
static |
Definition at line 308 of file qcepallocator.cpp.
Referenced by QcepDataArray::QcepDataArray(), QcepDataColumn::QcepDataColumn(), QcepImageDataBase::QcepImageDataBase(), QcepIntegratedData::QcepIntegratedData(), QcepIntegratedData::resize(), QcepDataColumn::resize(), and QcepImageData< T >::resize().
|
static |
Definition at line 316 of file qcepallocator.cpp.
References allocateBytes().
|
protected |
Definition at line 323 of file qcepallocator.cpp.
References g_AllocatedMemory, m_AllocatedMemoryMB, m_Mutex, and MegaBytes.
Referenced by allocate().
|
static |
Definition at line 392 of file qcepallocator.cpp.
References g_AllocatedMemory.
Referenced by main().
double QcepAllocator::allocatedMemoryMB | ( | ) |
Definition at line 387 of file qcepallocator.cpp.
References m_AllocatedMemoryMB.
Referenced by newDoubleImage(), newDoubleImageAndIntegratedData(), newInt16Image(), newInt32Image(), newIntegratedData(), and newMask().
|
privateslot |
Definition at line 382 of file qcepallocator.cpp.
References m_AllocatedMemoryMB.
Referenced by QcepAllocator().
void QcepAllocator::changedSizeMB | ( | int | newMB | ) |
Definition at line 407 of file qcepallocator.cpp.
|
static |
Definition at line 333 of file qcepallocator.cpp.
Referenced by QcepDataArray::~QcepDataArray(), QcepDataColumn::~QcepDataColumn(), QcepImageDataBase::~QcepImageDataBase(), and QcepIntegratedData::~QcepIntegratedData().
|
static |
Definition at line 341 of file qcepallocator.cpp.
References deallocateBytes().
|
protected |
Definition at line 348 of file qcepallocator.cpp.
References g_AllocatedMemory, m_AllocatedMemoryMB, m_Mutex, and MegaBytes.
Referenced by deallocate().
int QcepAllocator::doubleSizeMB | ( | int | width, |
int | height | ||
) |
Definition at line 367 of file qcepallocator.cpp.
References MegaBytes.
Referenced by newDoubleImage(), and newDoubleImageAndIntegratedData().
int QcepAllocator::int16SizeMB | ( | int | width, |
int | height | ||
) |
Definition at line 357 of file qcepallocator.cpp.
References MegaBytes.
Referenced by newInt16Image().
int QcepAllocator::int32SizeMB | ( | int | width, |
int | height | ||
) |
Definition at line 362 of file qcepallocator.cpp.
References MegaBytes.
Referenced by newInt32Image().
int QcepAllocator::integratedSizeMB | ( | int | nrows | ) |
Definition at line 377 of file qcepallocator.cpp.
References MegaBytes.
Referenced by newDoubleImageAndIntegratedData(), and newIntegratedData().
int QcepAllocator::maskSizeMB | ( | int | width, |
int | height | ||
) |
Definition at line 372 of file qcepallocator.cpp.
References MegaBytes.
Referenced by newMask().
double QcepAllocator::maximumMemory | ( | ) |
Definition at line 402 of file qcepallocator.cpp.
References MegaBytes.
double QcepAllocator::maximumMemoryMB | ( | ) |
Definition at line 397 of file qcepallocator.cpp.
QMutex * QcepAllocator::mutex | ( | ) |
Definition at line 85 of file qcepallocator.cpp.
References m_Mutex.
Referenced by newDoubleImage(), newDoubleImageAndIntegratedData(), newInt16Image(), newInt32Image(), newIntegratedData(), and newMask().
|
static |
Definition at line 169 of file qcepallocator.cpp.
References allocatedMemoryMB(), DEBUG_ALLOCATOR, doubleSizeMB(), g_Application, HEXARG, mutex(), QcepApplication::printMessage(), qcepDebug(), and waitTillAvailable().
Referenced by QxrdDetectorProcessor::doDarkSubtraction(), QxrdGenerateTestImage::generateChiImage(), QxrdGenerateTestImage::generateTTHImage(), newDoubleImage(), QxrdDetectorProcessor::onBadPixelsPathChanged(), QxrdIntegratorCache::performIntegration(), and QxrdDataProcessorBase::takeNextFreeImage().
|
static |
Definition at line 194 of file qcepallocator.cpp.
References g_Application, newDoubleImage(), and NullIfNotAvailable.
|
static |
Definition at line 281 of file qcepallocator.cpp.
References allocatedMemoryMB(), DEBUG_ALLOCATOR, doubleSizeMB(), g_Application, HEXARG, integratedSizeMB(), mutex(), QcepApplication::printMessage(), qcepDebug(), and waitTillAvailable().
Referenced by QxrdDataProcessorThreaded::integrateData().
|
static |
Definition at line 119 of file qcepallocator.cpp.
References allocatedMemoryMB(), DEBUG_ALLOCATOR, g_Application, HEXARG, int16SizeMB(), mutex(), QcepApplication::printMessage(), qcepDebug(), and waitTillAvailable().
Referenced by QxrdDetectorPerkinElmer::onEndFrame(), and QxrdDetectorSimulated::onTimerTimeout().
|
static |
Definition at line 144 of file qcepallocator.cpp.
References allocatedMemoryMB(), DEBUG_ALLOCATOR, g_Application, HEXARG, int32SizeMB(), mutex(), QcepApplication::printMessage(), qcepDebug(), and waitTillAvailable().
Referenced by QxrdAcquisition::doAcquire(), QxrdAcquisition::doAcquireDark(), QxrdDetectorPilatus::loadAndPush(), QxrdDetectorProcessor::onDarkImagePathChanged(), and QxrdIntegratorCache::performIntegration().
|
static |
Definition at line 235 of file qcepallocator.cpp.
References allocatedMemoryMB(), DEBUG_ALLOCATOR, g_Application, HEXARG, integratedSizeMB(), mutex(), QcepApplication::printMessage(), qcepDebug(), and waitTillAvailable().
Referenced by QxrdDataProcessorThreaded::integrateSaveAndDisplay(), newIntegratedData(), QxrdDataProcessorBase::newOutputScan(), QxrdDataProcessorThreaded::onCorrectedImageAvailable(), QxrdIntegrator::performIntegration(), and QxrdDataProcessorThreaded::slicePolygon().
|
static |
Definition at line 264 of file qcepallocator.cpp.
References g_Application, newIntegratedData(), and NullIfNotAvailable.
|
static |
Definition at line 210 of file qcepallocator.cpp.
References allocatedMemoryMB(), DEBUG_ALLOCATOR, g_Application, HEXARG, maskSizeMB(), mutex(), QcepApplication::printMessage(), qcepDebug(), and waitTillAvailable().
Referenced by QcepMaskData::copyMask(), QxrdAcquisition::doAcquire(), QxrdAcquisition::doAcquireDark(), QxrdDataProcessorBase::findZingers(), QxrdDataProcessorBase::loadMask(), QxrdDataProcessorBase::newMaskStack(), QxrdDetectorProcessor::onMaskPathChanged(), and QxrdDataProcessorBase::pushMaskStack().
|
virtual |
Reimplemented from QcepObject.
Definition at line 70 of file qcepallocator.cpp.
References m_Mutex, MegaBytes, and QcepObject::readSettings().
|
private |
Definition at line 90 of file qcepallocator.cpp.
References AllocateFromReserve, AlwaysAllocate, DEBUG_ALLOCATOR, g_Application, m_AllocatedMemoryMB, m_Mutex, QcepThread::msleep(), NullIfNotAvailable, QcepApplication::printMessage(), qcepDebug(), and WaitTillAvailable.
Referenced by newDoubleImage(), newDoubleImageAndIntegratedData(), newInt16Image(), newInt32Image(), newIntegratedData(), and newMask().
|
virtual |
Reimplemented from QcepObject.
Definition at line 63 of file qcepallocator.cpp.
References m_Mutex, and QcepObject::writeSettings().
|
private |
Definition at line 86 of file qcepallocator.h.
Referenced by allocateBytes(), allocatedMemoryMB(), allocatorHeartbeat(), deallocateBytes(), and waitTillAvailable().
|
private |
Definition at line 84 of file qcepallocator.h.
Referenced by allocateBytes(), deallocateBytes(), mutex(), readSettings(), waitTillAvailable(), and writeSettings().
|
private |
Definition at line 85 of file qcepallocator.h.
Referenced by QcepAllocator().
|
readwrite |
Definition at line 103 of file qcepallocator.h.
|
readwrite |
Definition at line 91 of file qcepallocator.h.
|
readwrite |
Definition at line 100 of file qcepallocator.h.
|
readwrite |
Definition at line 94 of file qcepallocator.h.
|
readwrite |
Definition at line 97 of file qcepallocator.h.