Adding commandsTailoring the softwareSpecifying a busy managerDocumenting event segment packet types

Documenting event segment packet types

By convention, events consist of packets of the following form show in the figure Event packet format

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;
	 }
      

Report documentation errors to Ron Fox (fox@nscl.msu.edu)or NSCL's Bugzilla page

Adding commandsTailoring the softwareSpecifying a busy managerDocumenting event segment packet types