#include <TGo4BufferQueue.h>
Inheritance diagram for TGo4BufferQueue:
Public Methods | |
TGo4BufferQueue () | |
TGo4BufferQueue (const char *name) | |
void | AddBufferFromObject (TObject *object) |
Reconstruct a TObject queue entry from a given TBuffer pointer. More... | |
void | AddBuffer (TBuffer *buffer, Bool_t clone=kFALSE) |
Add buffer pointer to queue. More... | |
void | FreeBuffer (TBuffer *buffer) |
Free internal buffer to be re-used by the AddBuffer as clone method. More... | |
virtual void | Clear (Option_t *opt="") |
Empty the queue and give free buffers back. More... | |
TBuffer * | WaitBuffer () |
Wait for buffer object from queue. More... | |
TObject * | WaitObjectFromBuffer () |
Wait for buffer object from queue. More... | |
virtual | ~TGo4BufferQueue () |
Static Public Methods | |
TBuffer * | CreateValueBuffer (UInt_t val) |
Create a root buffer that contains a single value val. More... | |
Int_t | DecodeValueBuffer (TBuffer *buf) |
Extract value from buffer that was created by CreateValueBuffer method. More... | |
Static Public Attributes | |
const Int_t | fgiISOWNER = BIT(14) |
.we emulate the protected owner flag of the TBuffer class, needed for reallocation! More... | |
Private Methods | |
void | InitBuffers () |
Initialization of internal queue buffer. More... | |
void | Realloc (TBuffer *buffer, Int_t oldsize, Int_t newsize) |
Reallocate buffer of TBuffer to newsize. More... | |
TBuffer * | NewEntry () |
Create dummy buffer for queue. More... | |
Private Attributes | |
TList * | fxBufferList |
List of preallocated buffer TBuffers which are used when TBuffer added to queue should be "cloned". More... | |
TList * | fxFreeList |
List of buffers which are free for the next add. More... | |
TMutex * | fxBufferMutex |
Int_t | fiOverflowcount |
TIterator * | fxBufferIterator |
Iterator for fxBufferList. More... | |
Int_t | fiMaxBuffers |
Number of preallocated buffer TBuffers (maximum entries in fxBufferList). More... |
Is able to stream any external TObject into a TBuffer which then is added to the queue.
Definition at line 30 of file TGo4BufferQueue.h.
|
Definition at line 40 of file TGo4BufferQueue.cxx. References InitBuffers(), and TRACE. |
|
Definition at line 48 of file TGo4BufferQueue.cxx. References InitBuffers(), and TRACE. |
|
Definition at line 73 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 209 of file TGo4BufferQueue.cxx. References TGo4Queue::Add(), 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 139 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 256 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 291 of file TGo4BufferQueue.cxx. References FreeBuffer(), and TGo4Queue::Next(). Referenced by TGo4GUIRegistry::StopMonitoring(). |
|
Wait for buffer object from queue. We Renamed the protected baseclass method to avoid user confusion. Definition at line 84 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 93 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. 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 56 of file TGo4BufferQueue.cxx. References fiMaxBuffers, fxBufferIterator, fxBufferList, fxBufferMutex, fxFreeList, i, 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. Referenced by AddBuffer(), and InitBuffers(). |
|
.we emulate the protected owner flag of the TBuffer class, needed for reallocation!
Definition at line 34 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 132 of file TGo4BufferQueue.h. Referenced by AddBuffer(), FreeBuffer(), InitBuffers(), and ~TGo4BufferQueue(). |
|
List of buffers which are free for the next add.
Definition at line 135 of file TGo4BufferQueue.h. Referenced by AddBuffer(), FreeBuffer(), and InitBuffers(). |
|
Definition at line 136 of file TGo4BufferQueue.h. Referenced by AddBuffer(), FreeBuffer(), InitBuffers(), and ~TGo4BufferQueue(). |
|
Definition at line 137 of file TGo4BufferQueue.h. |
|
Iterator for fxBufferList.
Definition at line 140 of file TGo4BufferQueue.h. Referenced by InitBuffers(), and ~TGo4BufferQueue(). |
|
Number of preallocated buffer TBuffers (maximum entries in fxBufferList).
Definition at line 146 of file TGo4BufferQueue.h. Referenced by AddBuffer(), and InitBuffers(). |