#include <RawCache.h>
Public Member Functions | |
RawMsgBuf * | getMsgToWrite () |
void | initialise (unsigned int nMsgs, unsigned int cellSize) |
void | printUsage () const |
void | releaseMsg (unsigned int fuResourceId) |
virtual | ~RawCache () |
Static Public Member Functions | |
static RawCache * | getInstance () |
Private Member Functions | |
int | getFreeSlot () const |
RawCache () | |
void | setFree (RawMsgBuf *rawCell) |
Private Attributes | |
unsigned int | cellSize_ |
bool | initialised_ |
RawMsgBuf ** | msgs_ |
unsigned int | nMsgs_ |
bool * | slotUsage_ |
Static Private Attributes | |
static RawCache * | instance_ = 0 |
Contains an array of RawMsgBuffer objects, as a backup for raw messages being sent over the message queue. In case event processors crash, these message buffers will be sent again.
Definition at line 28 of file RawCache.h.
|
virtual |
|
private |
|
private |
Definition at line 99 of file RawCache.cc.
References i, nMsgs_, and slotUsage_.
Referenced by getMsgToWrite().
|
static |
Returns the unique instance of this object.
Definition at line 25 of file RawCache.cc.
References instance_, and RawCache().
Referenced by evf::FUResourceQueue::discard(), evf::FUResourceQueue::discardWhileHalting(), and evf::FUResourceQueue::initialize().
RawMsgBuf * RawCache::getMsgToWrite | ( | ) |
Returns a pointer to a message buffer ready to be written with raw data.
Definition at line 61 of file RawCache.cc.
References gather_cfg::cout, getFreeSlot(), msgs_, printUsage(), stor::utils::sleep(), and slotUsage_.
Referenced by evf::FUResourceQueue::buildResource().
void RawCache::initialise | ( | unsigned int | nMsgs, |
unsigned int | cellSize | ||
) |
Initialize the cache with the given number of message buffers, and the given raw cell size for each one.
Definition at line 32 of file RawCache.cc.
References cellSize_, i, evf::RawMsgBuf::initialise(), initialised_, MAX_MSG_SIZE, msgs_, nMsgs_, evf::RAW_MESSAGE_TYPE, and slotUsage_.
void RawCache::printUsage | ( | ) | const |
Prints the current slot usage in the cache.
Definition at line 117 of file RawCache.cc.
References gather_cfg::cout, i, nMsgs_, and slotUsage_.
Referenced by getMsgToWrite().
void RawCache::releaseMsg | ( | unsigned int | fuResourceId | ) |
Releases a message buffer in the cache.
Definition at line 77 of file RawCache.cc.
References evf::FUShmRawCell::clear(), gather_cfg::cout, newFWLiteAna::found, i, msgs_, nMsgs_, evf::RawMsgBuf::rawCell(), setFree(), and slotUsage_.
Referenced by evf::FUResourceQueue::discard(), and evf::FUResourceQueue::discardWhileHalting().
|
private |
Definition at line 106 of file RawCache.cc.
References gather_cfg::cout, i, msgs_, nMsgs_, and slotUsage_.
Referenced by releaseMsg().
|
private |
Definition at line 68 of file RawCache.h.
Referenced by initialise().
|
private |
Definition at line 66 of file RawCache.h.
Referenced by initialise().
|
staticprivate |
Definition at line 60 of file RawCache.h.
Referenced by getInstance().
|
private |
Definition at line 67 of file RawCache.h.
Referenced by getMsgToWrite(), initialise(), releaseMsg(), setFree(), and ~RawCache().
|
private |
Definition at line 68 of file RawCache.h.
Referenced by getFreeSlot(), initialise(), printUsage(), releaseMsg(), and setFree().
|
private |
Definition at line 69 of file RawCache.h.
Referenced by getFreeSlot(), getMsgToWrite(), initialise(), printUsage(), releaseMsg(), setFree(), and ~RawCache().