JANA2
JEventMessage Struct Referenceabstract

A JEventMessage is an interface used by JTransport for streaming individual events. More...

#include <JMessage.h>

Inheritance diagram for JEventMessage:
Collaboration diagram for JEventMessage:

Public Member Functions

virtual size_t get_event_number () const =0
 Determine what the event number should be for the JEvent that gets emitted for this message. More...
 
virtual size_t get_run_number () const =0
 Determine what the run number should be for the JEvent that gets emitted for this message. More...
 
- Public Member Functions inherited from JMessage
virtual char * as_buffer ()=0
 Expose the underlying buffer via a raw pointer. More...
 
virtual const char * as_buffer () const =0
 Expose the underlying buffer via a raw pointer. More...
 
virtual size_t get_buffer_capacity () const =0
 Determine the length of the buffer itself, a.k.a. More...
 
virtual size_t get_buffer_size () const
 Determine the length of the buffer's contents, a.k.a. More...
 
virtual bool is_end_of_stream () const =0
 Determine whether this is the last message. More...
 
- Public Member Functions inherited from JObject
virtual const std::string className () const
 
void AddAssociatedObject (const JObject *obj)
 
void AddAssociatedObjectAutoDelete (JObject *obj, bool auto_delete=true)
 
void RemoveAssociatedObject (const JObject *obj)
 
void ClearAssociatedObjects (void)
 
bool IsAssociated (const JObject *locObject) const
 
virtual void Summarize (JObjectSummary &summary) const
 

Additional Inherited Members

- Protected Attributes inherited from JObject
std::set< const JObject * > associated
 
std::set< JObject * > auto_delete
 

Detailed Description

A JEventMessage is an interface used by JTransport for streaming individual events.

In other words, this assumes that event building is done upstream. Each JEventMessage will be inserted into its own brand new JEvent just like any other JObject. The implementor is responsible for figuring out the event and run numbers. The code for parsing the message payload could either be expressed as getter methods on the JEventMessage implementation, or in its own JFactory. If the message format is the same as the in-memory representation (non-portable but fast), the JEventMessage can be defined as a plain-old-data struct and the char* buffer obtained via reinterpret_cast.

Member Function Documentation

virtual size_t JEventMessage::get_event_number ( ) const
pure virtual

Determine what the event number should be for the JEvent that gets emitted for this message.

This information should be available from the message payload. If not, return zero, in which case the JStreamingEventSource will issue an event number automatically.

virtual size_t JEventMessage::get_run_number ( ) const
pure virtual

Determine what the run number should be for the JEvent that gets emitted for this message.

This information should be available from the message payload. If not, return zero, in which case the JStreamingEventSource will use the last known run number.


The documentation for this struct was generated from the following file: