Sirikata
|
#include <SizedThreadSafeQueue.hpp>
Public Member Functions | |
void | reset () |
uint32 | maxSize () const |
uint32 | filledSize () const |
SizedResourceMonitor (uint32 limit) | |
template<class T > | |
bool | preIncrement (T value, bool force) |
template<class T > | |
bool | preIncrement (T *value, bool force) |
template<class T > | |
void | postDecrement (T value) |
template<class T > | |
void | postDecrement (T *value) |
template<class T > | |
bool | probablyCanPush (T t) |
template<class T > | |
bool | probablyCanPush (T *t) |
bool | probablyCanPush (size_t size) |
Private Attributes | |
AtomicValue< int32 > | mSize |
const int32 | mLimit |
Sirikata::SizedResourceMonitor::SizedResourceMonitor | ( | uint32 | limit | ) | [inline] |
References mLimit.
uint32 Sirikata::SizedResourceMonitor::filledSize | ( | ) | const [inline] |
References mSize, and Sirikata::AtomicValue< T >::read().
Referenced by Sirikata::Network::ASIOSocketWrapper::canSend(), Sirikata::RegionODPFlowScheduler::size(), and Sirikata::CSFQODPFlowScheduler::size().
uint32 Sirikata::SizedResourceMonitor::maxSize | ( | ) | const [inline] |
References mLimit.
Referenced by Sirikata::Network::ASIOSocketWrapper::canSend().
void Sirikata::SizedResourceMonitor::postDecrement | ( | T | value | ) | [inline] |
References mSize.
void Sirikata::SizedResourceMonitor::postDecrement | ( | T * | value | ) | [inline] |
References mSize.
bool Sirikata::SizedResourceMonitor::preIncrement | ( | T | value, |
bool | force | ||
) | [inline] |
bool Sirikata::SizedResourceMonitor::preIncrement | ( | T * | value, |
bool | force | ||
) | [inline] |
bool Sirikata::SizedResourceMonitor::probablyCanPush | ( | T * | t | ) | [inline] |
References mLimit, mSize, and Sirikata::AtomicValue< T >::read().
bool Sirikata::SizedResourceMonitor::probablyCanPush | ( | T | t | ) | [inline] |
References mLimit, mSize, and Sirikata::AtomicValue< T >::read().
bool Sirikata::SizedResourceMonitor::probablyCanPush | ( | size_t | size | ) | [inline] |
References mLimit, mSize, and Sirikata::AtomicValue< T >::read().
void Sirikata::SizedResourceMonitor::reset | ( | ) | [inline] |
References mSize.
const int32 Sirikata::SizedResourceMonitor::mLimit [private] |
Referenced by maxSize(), preIncrement(), probablyCanPush(), and SizedResourceMonitor().
AtomicValue<int32> Sirikata::SizedResourceMonitor::mSize [private] |
Referenced by filledSize(), postDecrement(), preIncrement(), probablyCanPush(), and reset().