#include <CNSCLOutputBuffer.h>
Inheritance diagram for CNSCLOutputBuffer:
Public Methods | |
CNSCLOutputBuffer (unsigned nWords=4096) | |
Default constructor. | |
~CNSCLOutputBuffer () | |
Destructor. | |
DAQWordBuffer & | getBuffer () |
DAQWordBufferPtr | getBufferPtr () const |
int | getWords () const |
unsigned long | getSequence () const |
unsigned short | getEntityCount () |
void | ComputeSize () |
void | SetType (int nType) |
void | ComputeChecksum () |
DAQWordBufferPtr | StartEntity () |
void | EndEntity (const DAQWordBufferPtr &ePtr) |
void | SetCpuNum (unsigned short nValue=0) |
void | SetNbitRegisters (unsigned nBitReg=1) |
void | SetLamRegisters (unsigned short nLams=0) |
void | PutEntity (void *pEntity, unsigned int nWords) |
void | PutLong (const unsigned long &rLong) |
void | PutWord (unsigned short nData) |
void | PutWords (const unsigned short *pWords, unsigned int nWords) |
void | PutString (const char *pData, int nMaxSize=-1) |
void | SetRun (unsigned short nRun) |
bool | EntityFits (unsigned short nWords) |
void | Route (bool NextSequence=true) |
void | Seek (int nOffset, int whence=SEEK_SET) |
void | Seek (DAQWordBufferPtr &rPtr) |
void | Resize (int newsize) |
Static Public Methods | |
void | IncrementSequence () |
void | ClearSequence () |
Protected Methods | |
void | InitializeHeader () |
Protected Attributes | |
DAQWordBuffer | m_Buffer |
Spectrodaq Buffer to hold the data being emitted. | |
Static Protected Attributes | |
int | m_ControlTag = 3 |
int | m_EventTag = 2 |
Private Methods | |
CNSCLOutputBuffer (const CNSCLOutputBuffer &rhs) | |
Copy constructor. | |
CNSCLOutputBuffer & | operator= (const CNSCLOutputBuffer &rhs) |
Assignment. | |
int | operator== (const CNSCLOutputBuffer &rhs) const |
Comparison for equality. | |
int | operator!= (const CNSCLOutputBuffer &rhs) const |
Private Attributes | |
DAQWordBufferPtr | m_BufferPtr |
'pointer' to the current slot of the buffer. | |
int | m_nWords |
Number of words the buffer can hold. | |
Static Private Attributes | |
unsigned long | m_nSequence = 0 |
Sequence number for the buffer. |
NSCL Data Acquisition system buffers have a fixed header and variable body. The "shape" of the body depends on the 'type' word of the buffer header. This set of classes simplifies the creation of the body of a buffer as well as synchonizing the body contents with the appropriate fields of the header.
Definition at line 314 of file CNSCLOutputBuffer.h.
|
Default constructor. Default constructor. This is called when declarations of the form e.g.:
Definition at line 343 of file CNSCLOutputBuffer.cpp. References InitializeHeader(). |
|
Destructor.
Definition at line 330 of file CNSCLOutputBuffer.h. |
|
Copy constructor.
|
|
Clears the sequence number. Definition at line 778 of file CNSCLOutputBuffer.cpp. References m_nSequence. Referenced by CExperiment::EmitStart(). |
|
Computes the buffer checksum and places it in the checksum field of the buffer. The checksum is computed such that the sum of the used words in the buffer is zero.
Definition at line 393 of file CNSCLOutputBuffer.cpp. References hdrWCKS, hdrWSIZE, and m_Buffer. Referenced by Route(). |
|
Uses the current buffer pointer to determine the number of words in the buffer. The resulting value is set in the buffer size word of the buffer header. Definition at line 360 of file CNSCLOutputBuffer.cpp. References hdrWSIZE, m_Buffer, and m_BufferPtr. Referenced by Route(). |
|
Ends an entity insertion into the buffer. The Entity count field of the buffer is incremented.
Definition at line 429 of file CNSCLOutputBuffer.cpp. References hdrWENTITY, m_Buffer, and m_BufferPtr. Referenced by PutEntity(), and CNSCLStringListBuffer::PutEntityString(). |
|
Determines if an entity will fit in the buffer free space. The free space is defined to be the words between the current offset of m_BufferPtr and the end of the buffer.
Definition at line 674 of file CNSCLOutputBuffer.cpp. References m_BufferPtr, and m_nWords. Referenced by CNSCLStringListBuffer::PutEntityString(), and CExperiment::ReadEvent(). |
|
Definition at line 344 of file CNSCLOutputBuffer.h. References m_Buffer. Referenced by CNSCLControlBuffer::CNSCLControlBuffer(), CNSCLPhysicsBuffer::CNSCLPhysicsBuffer(), CNSCLScalerBuffer::CNSCLScalerBuffer(), and CNSCLStringListBuffer::CNSCLStringListBuffer(). |
|
Definition at line 348 of file CNSCLOutputBuffer.h. References m_BufferPtr. Referenced by CNSCLStringListBuffer::PutEntityString(). |
|
Return the number of entities currently in the buffer. Definition at line 826 of file CNSCLOutputBuffer.cpp. References hdrWENTITY, and m_Buffer. Referenced by CExperiment::TriggerScalerReadout(). |
|
Definition at line 356 of file CNSCLOutputBuffer.h. References m_nSequence. |
|
Definition at line 352 of file CNSCLOutputBuffer.h. References m_nWords. Referenced by CNSCLPhysicsBuffer::EndEvent(). |
|
Increments the sequence number. Definition at line 767 of file CNSCLOutputBuffer.cpp. References m_nSequence. Referenced by Route(). |
|
Utility function to initialize the buffer header. Definition at line 786 of file CNSCLOutputBuffer.cpp. References BODYOFFSET, hdrLSEQ, hdrLSIG, hdrWBUFFMT, hdrWCKS, hdrWENTITY, hdrWSIG, hdrWSIZE, hdrWTYPE, hdrWUNUSED1, hdrWUNUSED2, hdrWUNUSED3, LSIGNATURE, m_Buffer, m_BufferPtr, m_nSequence, REVLEVEL, and SSIGNATURE. Referenced by CNSCLOutputBuffer(), and Route(). |
|
|
|
Assignment.
|
|
Comparison for equality.
|
|
Puts a stream of words into the buffer and increments the entity count field of the buffer header.
Definition at line 509 of file CNSCLOutputBuffer.cpp. References EndEntity(), and StartEntity(). Referenced by CNSCLScalerBuffer::PutScalerVector(). |
|
Put a long word in the buffer in native system order. The buffer pointer is affected. This is only useful for non-entity words.
Definition at line 532 of file CNSCLOutputBuffer.cpp. References m_BufferPtr. Referenced by CNSCLControlBuffer::PutTimeOffset(). |
|
Put a null terminated character array into the buffer. Note that strings in NSCL buffers must be an even number of bytes (including their null terminator). If necessary, an additional blank is added to the string. If the string is being put into a fixed size field and is shorter than the buffer field, it is null filled, otherwise it is truncated in a manner which allows the buffer to contain a trailing null.
Definition at line 601 of file CNSCLOutputBuffer.cpp. References m_BufferPtr. Referenced by CNSCLStringListBuffer::PutEntityString(), and CNSCLControlBuffer::PutTitle(). |
|
Puts a word of data into the buffer. This is only useful for non-entity words.
Definition at line 554 of file CNSCLOutputBuffer.cpp. References m_BufferPtr. Referenced by CNSCLControlBuffer::SetTime(). |
|
Puts an array of words into the buffer.
Definition at line 572 of file CNSCLOutputBuffer.cpp. References m_BufferPtr. |
|
Resize the buffer as requested.
Definition at line 836 of file CNSCLOutputBuffer.cpp. References m_Buffer. |
|
Submits the buffer to the spectrodaq server for distribution. The buffer state is set to empty again, once this is done... although to work around bugs in the spectrodaq server it is recommended that this buffer be destroyed after a route.
Definition at line 705 of file CNSCLOutputBuffer.cpp. References ComputeChecksum(), ComputeSize(), IncrementSequence(), InitializeHeader(), m_Buffer, and m_nWords. Referenced by CExperiment::EmitEnd(), CExperiment::EmitPause(), CExperiment::EmitResume(), CExperiment::EmitStart(), CExperiment::Overflow(), CExperiment::ReadEvent(), CExperiment::TriggerDocBuffer(), CExperiment::TriggerRunVariableBuffer(), CExperiment::TriggerScalerReadout(), CExperiment::TriggerSnapshotScaler(), and CExperiment::TriggerStateVariableBuffer(). |
|
Definition at line 384 of file CNSCLOutputBuffer.h. References m_BufferPtr. |
|
Seek the buffer pointer to a particular location.
Definition at line 732 of file CNSCLOutputBuffer.cpp. References m_Buffer, m_BufferPtr, and m_nWords. Referenced by CNSCLScalerBuffer::CNSCLScalerBuffer(), CNSCLPhysicsBuffer::EndEvent(), CNSCLControlBuffer::PutTimeOffset(), CNSCLControlBuffer::PutTitle(), and CNSCLControlBuffer::SetTime(). |
|
Sets the Cpu number field of the buffer. The CPU number field is used to identify wich system the data in this buffer came from. By convention, this field is the least two significant octets of the system's IP address.. in network byte order. If the function's parameter value is zero, this is determined and used. Otherwise, the parameter is the value.
Definition at line 452 of file CNSCLOutputBuffer.cpp. |
|
Sets the nlam field of the buffer header.
Definition at line 495 of file CNSCLOutputBuffer.cpp. References hdrWUNUSED1, and m_Buffer. |
|
Sets the nbit field in the buffer header.
Definition at line 476 of file CNSCLOutputBuffer.cpp. References hdrWUNUSED2, and m_Buffer. |
|
Set the run number field of the buffer header.
Definition at line 659 of file CNSCLOutputBuffer.cpp. References hdrWRUN, and m_Buffer. Referenced by CExperiment::EmitEnd(), CExperiment::EmitPause(), CExperiment::EmitResume(), CExperiment::EmitStart(), CExperiment::Overflow(), CExperiment::ReadEvent(), CExperiment::TriggerDocBuffer(), CExperiment::TriggerRunVariableBuffer(), CExperiment::TriggerScalerReadout(), CExperiment::TriggerSnapshotScaler(), and CExperiment::TriggerStateVariableBuffer(). |
|
Sets the type field of the buffer
Definition at line 373 of file CNSCLOutputBuffer.cpp. References hdrWTYPE, and m_Buffer. Referenced by CNSCLBeginBuffer::CNSCLBeginBuffer(), CNSCLDocumentationBuffer::CNSCLDocumentationBuffer(), CNSCLEndBuffer::CNSCLEndBuffer(), CNSCLPauseBuffer::CNSCLPauseBuffer(), CNSCLPhysicsBuffer::CNSCLPhysicsBuffer(), CNSCLResumeBuffer::CNSCLResumeBuffer(), CNSCLScalerBuffer::CNSCLScalerBuffer(), CRunVariableBuffer::CRunVariableBuffer(), CStateVariableBuffer::CStateVariableBuffer(), CExperiment::EmitEnd(), CExperiment::EmitPause(), CExperiment::EmitResume(), CExperiment::EmitStart(), and CExperiment::TriggerSnapshotScaler(). |
|
Begins an entity in the buffer. At present this is a no-op.
Definition at line 415 of file CNSCLOutputBuffer.cpp. References m_BufferPtr. Referenced by PutEntity(), CNSCLStringListBuffer::PutEntityString(), and CNSCLPhysicsBuffer::StartEvent(). |
|
Spectrodaq Buffer to hold the data being emitted.
Definition at line 320 of file CNSCLOutputBuffer.h. Referenced by ComputeChecksum(), ComputeSize(), EndEntity(), getBuffer(), getEntityCount(), InitializeHeader(), Resize(), Route(), Seek(), SetCpuNum(), CNSCLScalerBuffer::SetEndTime(), SetLamRegisters(), SetNbitRegisters(), SetRun(), CNSCLScalerBuffer::SetStartTime(), and SetType(). |
|
'pointer' to the current slot of the buffer.
Definition at line 322 of file CNSCLOutputBuffer.h. Referenced by ComputeSize(), EndEntity(), EntityFits(), getBufferPtr(), InitializeHeader(), PutLong(), PutString(), PutWord(), PutWords(), Seek(), and StartEntity(). |
|
Definition at line 333 of file CNSCLOutputBuffer.cpp. Referenced by CNSCLControlBuffer::CNSCLControlBuffer(), CNSCLScalerBuffer::CNSCLScalerBuffer(), and CNSCLStringListBuffer::CNSCLStringListBuffer(). |
|
Definition at line 334 of file CNSCLOutputBuffer.cpp. Referenced by CNSCLPhysicsBuffer::CNSCLPhysicsBuffer(). |
|
Sequence number for the buffer.
Definition at line 331 of file CNSCLOutputBuffer.cpp. Referenced by ClearSequence(), getSequence(), IncrementSequence(), and InitializeHeader(). |
|
Number of words the buffer can hold.
Definition at line 323 of file CNSCLOutputBuffer.h. Referenced by EntityFits(), getWords(), Route(), and Seek(). |