JANA2
JEventGroup Class Reference

A persistent JObject. More...

#include <JEventGroupTracker.h>

Inheritance diagram for JEventGroup:
Collaboration diagram for JEventGroup:

Public Member Functions

int GetGroupId () const
 Report back what group this actual is. This is mostly for debugging purposes.
 
void StartEvent () const
 Record that another event belonging to this group has been emitted. More...
 
bool FinishEvent () const
 Report an event as finished. More...
 
void CloseGroup () const
 Indicate that no more events in the group are on their way. More...
 
bool IsGroupFinished () const
 Test whether all events in the group have finished. More...
 
void WaitUntilGroupFinished ()
 Block until every event in this group has finished, and the eventsource has declared the group closed. 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
 

Friends

class JEventGroupManager
 

Additional Inherited Members

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

Detailed Description

A persistent JObject.

Member Function Documentation

void JEventGroup::CloseGroup ( ) const
inline

Indicate that no more events in the group are on their way.

Note that groups can be re-opened by simply emitting another event tagged according to that group. This is meant to be called from JEventSource::GetEvent.

bool JEventGroup::FinishEvent ( ) const
inline

Report an event as finished.

If this was the last event in the group, IsGroupFinished will now return true. Please only call once per event, so that we don't have to maintain a set of outstanding event ids. This takes advantage of C++ atomics to detect if we were the one who finished the whole group without needing a lock. This is meant to be called from JEventProcessor::Process.

bool JEventGroup::IsGroupFinished ( ) const
inline

Test whether all events in the group have finished.

Two conditions have to hold:

  1. The number of in-flight events must be zero
  2. The group must be closed. Otherwise, if the JEventSource is slow but the JEventProcessor is fast, the number of in-flight events could drop to zero before the group is conceptually finished. This is meant to be callable from any JANA component. Note that this doesn't indicate anything about who
void JEventGroup::StartEvent ( ) const
inline

Record that another event belonging to this group has been emitted.

This is meant to be called from JEventSource::GetEvent.

void JEventGroup::WaitUntilGroupFinished ( )
inline

Block until every event in this group has finished, and the eventsource has declared the group closed.

This is meant to be callable from any JANA component.


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