JANA2
C++ framework for multi-threaded data processing
JEventMessage Struct Referenceabstract

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

#include <JMessage.h>

Inheritance diagram for JEventMessage:
[legend]
Collaboration diagram for JEventMessage:
[legend]

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
 
template<class T >
const T * GetSingle () const
 
template<class T >
std::vector< const T * > Get () const
 
template<typename T >
void GetSingle (const T *&ptrs, std::string classname="") const
 The following have been added purely for compatibility with JANA1, in order to make porting halld_recon more tractable. More...
 
template<typename T >
void GetT (std::vector< const T * > &ptrs) const
 
template<typename T >
void Get (std::vector< const T * > &ptrs, std::string classname="", int max_depth=1000000) const
 
template<typename T >
void GetAssociatedAncestors (std::set< const JObject * > &already_checked, int &max_depth, std::set< const T * > &objs_found, std::string classname="") 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

◆ get_event_number()

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.

◆ get_run_number()

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: