JANA2
C++ framework for multi-threaded data processing
|
JEventBuilder pulls JMessages off of a user-specified JTransport, aggregates them into JEvents using the JWindow of their choice, and decides which to keep via a user-specified JTrigger. More...
#include <JDiscreteJoin.h>
Public Member Functions | |
JDiscreteJoin (std::unique_ptr< JTransport > &&transport, std::unique_ptr< JTrigger > &&trigger=std::unique_ptr< JTrigger >(new JTrigger())) | |
void | Open () override |
Open is called by JANA when it is ready to accept events from this event source. More... | |
Result | Emit (JEvent &event) override |
Public Member Functions inherited from JEventSource | |
JEventSource (std::string resource_name, JApplication *app=nullptr) | |
virtual void | Init () |
virtual void | Preprocess (const JEvent &) const |
For work that should be done in parallel on a JEvent, but is tightly coupled to the JEventSource for some reason. More... | |
virtual void | FinishEvent (JEvent &) |
FinishEvent is used to notify the JEventSource that an event has been completely processed. More... | |
virtual void | Close () |
Close is called by JANA when it is finished accepting events from this event source. More... | |
virtual void | GetEvent (std::shared_ptr< JEvent >) |
GetEvent is called by JANA in order to emit a fresh event into the stream. More... | |
virtual bool | GetObjects (const std::shared_ptr< const JEvent > &, JFactory *) |
GetObjects was historically used for lazily unpacking data from a JEvent and putting it into a "dummy" JFactory. More... | |
std::string | GetResourceName () const |
uint64_t | GetEventCount () const |
uint64_t | GetEmittedEventCount () const |
uint64_t | GetFinishedEventCount () const |
virtual std::string | GetType () const |
std::string | GetName () const |
bool | IsGetObjectsEnabled () const |
bool | IsFinishEventEnabled () const |
bool | IsPreprocessEnabled () const |
uint64_t | GetNSkip () |
uint64_t | GetNEvents () |
virtual std::string | GetVDescription () const |
Optional for getting description via source rather than JEventSourceGenerator. | |
void | SetResourceName (std::string resource_name) |
void | EnableFinishEvent (bool enable=true) |
EnableFinishEvent() is intended to be called by the user in the constructor in order to tell JANA to call the provided FinishEvent method after all JEventProcessors have finished with a given event. More... | |
void | EnableGetObjects (bool enable=true) |
void | EnablePreprocess (bool enable=true) |
void | SetNEvents (uint64_t nevents) |
void | SetNSkip (uint64_t nskip) |
void | DoInitialize () |
virtual void | DoInit () |
void | DoOpen (bool with_lock=true) |
void | DoClose (bool with_lock=true) |
Result | DoNext (std::shared_ptr< JEvent > event) |
Result | DoNextCompatibility (std::shared_ptr< JEvent > event) |
void | DoFinishEvent (JEvent &event) |
void | Summarize (JComponentSummary &summary) const override |
Public Member Functions inherited from jana::components::JComponent | |
void | SetLevel (JEventLevel level) |
void | SetCallbackStyle (CallbackStyle style) |
void | SetPrefix (std::string prefix) |
void | SetTypeName (std::string type_name) |
For convenience, we provide a NAME_OF_THIS macro so that the user doesn't have to store the type name as a string, because that could get out of sync if automatic refactoring tools are used. | |
JApplication * | GetApplication () const |
JLogger & | GetLogger () |
std::string | GetPrefix () const |
JEventLevel | GetLevel () const |
std::string | GetLoggerName () const |
std::string | GetPluginName () const |
void | SetLoggerName (std::string logger_name) |
void | SetPluginName (std::string plugin_name) |
std::string | GetTypeName () const |
CallbackStyle | GetCallbackStyle () const |
Status | GetStatus () const |
void | SetApplication (JApplication *app) |
void | SetLogger (JLogger logger) |
template<typename F > | |
void | CallWithJExceptionWrapper (std::string func_name, F func) |
void | RegisterParameter (ParameterBase *parameter) |
void | RegisterService (ServiceBase *service) |
void | ConfigureAllParameters (std::map< std::string, std::string > fields) |
Static Public Member Functions | |
static std::string | GetDescription () |
Additional Inherited Members | |
Public Types inherited from JEventSource | |
enum class | Result { Success , FailureTryAgain , FailureFinished } |
Result describes what happened the last time a GetEvent() was attempted. More... | |
enum class | RETURN_STATUS { kSUCCESS , kNO_MORE_EVENTS , kBUSY , kTRY_AGAIN , kERROR , kUNKNOWN } |
The user is supposed to throw RETURN_STATUS::kNO_MORE_EVENTS or kBUSY from GetEvent() | |
Public Types inherited from jana::components::JComponent | |
enum class | Status { Uninitialized , Initialized , Opened , Closed , Finalized } |
enum class | CallbackStyle { LegacyMode , ExpertMode , DeclarativeMode } |
Protected Member Functions inherited from jana::components::JHasOutputs | |
void | RegisterOutput (OutputBase *output) |
Protected Attributes inherited from jana::components::JComponent | |
std::vector< ParameterBase * > | m_parameters |
std::vector< ServiceBase * > | m_services |
JEventLevel | m_level = JEventLevel::PhysicsEvent |
CallbackStyle | m_callback_style = CallbackStyle::LegacyMode |
std::string | m_prefix |
std::string | m_plugin_name |
std::string | m_logger_name |
std::string | m_type_name |
Status | m_status = Status::Uninitialized |
std::mutex | m_mutex |
JApplication * | m_app = nullptr |
JLogger | m_logger |
Protected Attributes inherited from jana::components::JHasOutputs | |
std::vector< OutputBase * > | m_outputs |
JEventBuilder pulls JMessages off of a user-specified JTransport, aggregates them into JEvents using the JWindow of their choice, and decides which to keep via a user-specified JTrigger.
The user can choose to merge this Event stream with additional JMessage streams, possibly applying a different trigger at each level. This is useful for level 2/3/n triggers and maybe EPICS data.
|
inlineoverridevirtual |
Open
is called by JANA when it is ready to accept events from this event source.
The implementor should open file pointers or sockets here, instead of in the constructor. This is because the implementor won't know how many or which event sources the user will decide to activate within one job. Thus the implementor can avoid problems such as running out of file pointers, or multiple event sources attempting to bind to the same socket.
Reimplemented from JEventSource.