JANA2
JEventSource Class Referenceabstract
Inheritance diagram for JEventSource:

Public Types

enum  SourceStatus {
  Unopened,
  Opened,
  Finished
}
 SourceStatus describes the current state of the EventSource.
 
enum  ReturnStatus {
  Success,
  TryAgain,
  Finished
}
 ReturnStatus describes what happened the last time a GetEvent() was attempted. More...
 
enum  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 Member Functions

 JEventSource (std::string resource_name, JApplication *app=nullptr)
 
virtual void Open ()
 
virtual void GetEvent (std::shared_ptr< JEvent >)=0
 
virtual bool GetObjects (const std::shared_ptr< const JEvent > &aEvent, JFactory *aFactory)
 
virtual void DoInitialize ()
 
ReturnStatus DoNext (std::shared_ptr< JEvent > event)
 
SourceStatus GetStatus () const
 
std::string GetPluginName () const
 
std::string GetTypeName () const
 
std::string GetResourceName () const
 
uint64_t GetEventCount () const
 
JApplicationGetApplication () const
 
virtual std::string GetType () const
 
std::string GetName () const
 
virtual std::string GetVDescription () const
 Optional for getting description via source rather than JEventSourceGenerator.
 
JFactoryGeneratorGetFactoryGenerator () const
 
void SetTypeName (std::string type_name)
 SetTypeName is intended as a replacement to GetType(), which should be less confusing for the user. More...
 
void SetFactoryGenerator (JFactoryGenerator *generator)
 
void SetApplication (JApplication *app)
 
void SetPluginName (std::string plugin_name)
 
void SetRange (uint64_t nskip, uint64_t nevents)
 

Member Enumeration Documentation

ReturnStatus describes what happened the last time a GetEvent() was attempted.

If GetEvent() reaches an error state, it should throw a JException instead.

Member Function Documentation

void JEventSource::SetTypeName ( std::string  type_name)
inline

SetTypeName is intended as a replacement to GetType(), which should be less confusing for the user.

It should be called from the constructor. For convenience, we provide a NAME_OF_THIS macro so that the user doesn't have to type the class name as a string, which may get out of sync if automatic refactoring tools are used.


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