#include <TGo4BufferQueue.h>
Inheritance diagram for TGo4BufferQueue:
Public Member Functions | |
TGo4BufferQueue () | |
TGo4BufferQueue (const char *name) | |
void | AddBufferFromObject (TObject *object) |
Reconstruct a TObject queue entry from a given TBuffer pointer. | |
void | AddBuffer (TBuffer *buffer, Bool_t clone=kFALSE) |
Add buffer pointer to queue. | |
void | FreeBuffer (TBuffer *buffer) |
Free internal buffer to be re-used by the AddBuffer as clone method. | |
virtual void | Clear (Option_t *opt="") |
Empty the queue and give free buffers back. | |
TBuffer * | WaitBuffer () |
Wait for buffer object from queue. | |
TObject * | WaitObjectFromBuffer () |
Wait for buffer object from queue. | |
virtual | ~TGo4BufferQueue () |
Static Public Member Functions | |
static TBuffer * | CreateValueBuffer (UInt_t val) |
Create a root buffer that contains a single value val. | |
static Int_t | DecodeValueBuffer (TBuffer *buf) |
Extract value from buffer that was created by CreateValueBuffer method. | |
Static Public Attributes | |
static const Int_t | fgiISOWNER = BIT(14) |
.we emulate the protected owner flag of the TBuffer class, needed for reallocation! | |
Private Member Functions | |
void | InitBuffers () |
Initialization of internal queue buffer. | |
void | Realloc (TBuffer *buffer, Int_t oldsize, Int_t newsize) |
Reallocate buffer of TBuffer to newsize. | |
TBuffer * | NewEntry () |
Create dummy buffer for queue. | |
Private Attributes | |
TList * | fxBufferList |
List of preallocated buffer TBuffers which are used when TBuffer added to queue should be "cloned". | |
TList * | fxFreeList |
List of buffers which are free for the next add. | |
TMutex * | fxBufferMutex |
Int_t | fiOverflowcount |
TIterator * | fxBufferIterator |
Iterator for fxBufferList. | |
Int_t | fiMaxBuffers |
Number of preallocated buffer TBuffers (maximum entries in fxBufferList). |
Is able to stream any external TObject into a TBuffer which then is added to the queue.
Definition at line 29 of file TGo4BufferQueue.h.
|
Definition at line 41 of file TGo4BufferQueue.cxx. References InitBuffers(), and TRACE. |
|
Definition at line 49 of file TGo4BufferQueue.cxx. References InitBuffers(), and TRACE. |
|
Definition at line 74 of file TGo4BufferQueue.cxx. References fxBufferIterator, fxBufferList, fxBufferMutex, and TRACE. |
|
Reconstruct a TObject queue entry from a given TBuffer pointer. To be used for streaming the receiving socket contents into the queue. Operation should be thread locked by the calling user. Definition at line 210 of file TGo4BufferQueue.cxx. References TGo4Queue::Add(), TGo4Buffer, and TRACE. Referenced by TGo4ClientTask::AddLocalCommand(), TGo4Task::GetStatus(), main(), TGo4ExampleApplication::SendData(), TGo4Task::SendObject(), TGo4Task::SendStatus(), TGo4ServerTask::SendStatus(), TGo4ExampleServer::StopWorkThreads(), and TGo4Task::SubmitCommand(). |
|
Add buffer pointer to queue. We Renamed the protected baseclass method to avoid user confusion. If clone is true, a clone (deep streamer copy) of the given buffer will be done and this clone is added to the queue. Definition at line 140 of file TGo4BufferQueue.cxx. References TGo4Queue::Add(), TGo4Log::Debug(), fiMaxBuffers, fxBufferList, fxBufferMutex, fxFreeList, NewEntry(), Realloc(), and TRACE. Referenced by main(), TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), TGo4CommandRunnable::Run(), TGo4Task::SendStatusBuffer(), TGo4ServerTask::SendStatusBuffer(), TGo4Task::SendStopBuffers(), TGo4Task::SubmitEmergencyCommand(), and TGo4Task::SubmitEmergencyData(). |
|
Free internal buffer to be re-used by the AddBuffer as clone method. To be used by the thread that got the buffer from WaitBuffer after working on it. If buffer does not belong to the internal buffers list of this queue, it is _not_ added to the free buffer list. Definition at line 257 of file TGo4BufferQueue.cxx. References TGo4Socket::fgiBUFINITSIZE, fxBufferList, fxBufferMutex, fxFreeList, Realloc(), and TRACE. Referenced by Clear(), TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), TGo4CommandRunnable::Run(), and WaitObjectFromBuffer(). |
|
Empty the queue and give free buffers back.
Reimplemented from TGo4Queue. Definition at line 292 of file TGo4BufferQueue.cxx. References FreeBuffer(), and TGo4Queue::Next(). Referenced by TGo4AnalysisProxy::ReceiveStatus(). |
|
Wait for buffer object from queue. We Renamed the protected baseclass method to avoid user confusion. Definition at line 85 of file TGo4BufferQueue.cxx. References TRACE, and TGo4Queue::Wait(). Referenced by main(), TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), TGo4CommandRunnable::Run(), and WaitObjectFromBuffer(). |
|
Wait for buffer object from queue. When buffer is received, object is reconstructed out of it (thread mainlock aqcuired!). NULL in case of unknown class. Definition at line 94 of file TGo4BufferQueue.cxx. References FreeBuffer(), TRACE, and WaitBuffer(). Referenced by TGo4Task::NextCommand(), TGo4ServerTask::NextCommand(), TGo4Task::NextObject(), and TGo4Task::NextStatus(). |
|
Create a root buffer that contains a single value val. This feature is used to wrap direct (emergency) commands into a TBuffer to send it via the taskhandler queues and sockets. Also used to indicate disconnect mode for the taskhandler threads. Definition at line 347 of file TGo4BufferQueue.cxx. References TGo4Buffer. Referenced by TGo4Task::SubmitEmergencyCommand(), TGo4Task::SubmitEmergencyData(), and TGo4Task::TGo4Task(). |
|
Extract value from buffer that was created by CreateValueBuffer method. Used to decode a direct command or disconnect value that is received from queue or socket connection. Negative value means no valid value buffer. Definition at line 358 of file TGo4BufferQueue.cxx. Referenced by TGo4TaskHandlerRunnable::CheckStopBuffer(). |
|
Initialization of internal queue buffer.
Definition at line 57 of file TGo4BufferQueue.cxx. References fiMaxBuffers, fxBufferIterator, fxBufferList, fxBufferMutex, fxFreeList, NewEntry(), and TRACE. Referenced by TGo4BufferQueue(). |
|
Reallocate buffer of TBuffer to newsize.
Definition at line 306 of file TGo4BufferQueue.cxx. References TGo4Socket::fgiBUFEXTRASPACE, and fgiISOWNER. Referenced by AddBuffer(), and FreeBuffer(). |
|
Create dummy buffer for queue.
Definition at line 333 of file TGo4BufferQueue.cxx. References TGo4Socket::fgiBUFINITSIZE, and TGo4Buffer. Referenced by AddBuffer(), and InitBuffers(). |
|
.we emulate the protected owner flag of the TBuffer class, needed for reallocation!
Definition at line 35 of file TGo4BufferQueue.cxx. Referenced by Realloc(). |
|
List of preallocated buffer TBuffers which are used when TBuffer added to queue should be "cloned". Each AddBuffer with option clone will memcopy the input buffer char field to the next TBuffer field in this list. Output buffer after WaitBuffer is then this internal TBuffer, not the input TBuffer. If all buffer buffers are in use, no further buffer is allowed to be added as clone. Definition at line 131 of file TGo4BufferQueue.h. Referenced by AddBuffer(), FreeBuffer(), InitBuffers(), and ~TGo4BufferQueue(). |
|
List of buffers which are free for the next add.
Definition at line 134 of file TGo4BufferQueue.h. Referenced by AddBuffer(), FreeBuffer(), and InitBuffers(). |
|
Definition at line 135 of file TGo4BufferQueue.h. Referenced by AddBuffer(), FreeBuffer(), InitBuffers(), and ~TGo4BufferQueue(). |
|
Definition at line 136 of file TGo4BufferQueue.h. |
|
Iterator for fxBufferList.
Definition at line 139 of file TGo4BufferQueue.h. Referenced by InitBuffers(), and ~TGo4BufferQueue(). |
|
Number of preallocated buffer TBuffers (maximum entries in fxBufferList).
Definition at line 145 of file TGo4BufferQueue.h. Referenced by AddBuffer(), and InitBuffers(). |