![]() | ![]() | ![]() | Documenting event segment packet types | ![]() |
By convention, events consist of packets of the following form show in the figure Event packet format
Documented event packets allow you to place entries in the event stream that document the set of event packets that can appear in the buffer. Readout software that uses documented packets are much more self documenting than those that don't.
To do this you should:
The code fragment below shows an implementation of an event segment that uses documented packets.
class CMySegment : public CEventSegment { private: CDocumentedPacket m_MyPacket; public: CMySegment(); ... virtual DAQWordBufferPtr& Read(DAQWordBufferPtr& rBuffer); ... }; ... CMySegment::CMySegment() : m_MyPacket(0xaa, string("Example"), string("Example tag for Readout docs"), string("1.0")); {} DAQWordBufferPtr& CMySegment::Read(DAQWordBufferPtr& rBuffer) { ... rBuffer = m_MyPacket.Begin(rBuffer); // Read packet body... ... rBuffer = m_MyPacket.End(rBuffer); ... return rBuffer; }
![]() | ![]() | ![]() | Documenting event segment packet types | ![]() |