JANA2
|
Public Types | |
enum | JFactory_Flags_t { JFACTORY_NULL = 0x00, PERSISTENT = 0x01, WRITE_TO_OUTPUT = 0x02, NOT_OBJECT_OWNER = 0x04 } |
Public Member Functions | |
JFactory (std::string aName, std::string aTag="") | |
std::string | GetName () const |
std::string | GetTag () const |
uint32_t | GetPreviousRunNumber (void) const |
void | SetPreviousRunNumber (uint32_t aRunNumber) |
uint32_t | GetFactoryFlags (void) |
Get all flags in the form of a single word. | |
void | SetFactoryFlag (JFactory_Flags_t f) |
Set a flag (or flags) | |
void | ClearFactoryFlag (JFactory_Flags_t f) |
Clear a flag (or flags) | |
bool | TestFactoryFlag (JFactory_Flags_t f) |
Test if a flag (or set of flags) is set. | |
virtual std::type_index | GetObjectType () const =0 |
virtual void | ClearData ()=0 |
virtual void | Init () |
virtual void | ChangeRun (const std::shared_ptr< const JEvent > &aEvent) |
virtual void | Process (const std::shared_ptr< const JEvent > &aEvent) |
template<typename T > | |
void | Set (std::vector< T * > &items) |
template<typename S > | |
std::vector< S * > | GetAs () |
Access the encapsulated data, performing an upcast if necessary. More... | |
void | SetApplication (JApplication *app) |
JApplication setter. This is meant to be used under the hood. | |
JApplication * | GetApplication () |
JApplication getter. More... | |
Protected Types | |
enum | Status { Uninitialized, Unprocessed, Processed, Inserted } |
Protected Member Functions | |
virtual void | Set (std::vector< JObject * > &data)=0 |
virtual void | Insert (JObject *data)=0 |
Protected Attributes | |
std::string | mPluginName |
std::string | mFactoryName |
std::string | mObjectName |
std::string | mTag |
uint32_t | mFlags = 0 |
uint32_t | mPreviousRunNumber = -1 |
JApplication * | mApp = nullptr |
std::unordered_map< std::type_index, void * > | mUpcastVTable |
Status | mStatus = Status::Uninitialized |
std::mutex | mMutex |
std::once_flag | mInitFlag |
|
inline |
JApplication getter.
This is meant to be called by user-defined JFactories which need to acquire parameter values or services from JFactory::Init()
std::vector< S * > JFactory::GetAs | ( | ) |
Access the encapsulated data, performing an upcast if necessary.
This is useful for extracting data from all JFactories<T> where T extends a parent class S, such as JObject or TObject, in contexts where T is not known or it would introduce an unwanted coupling. The main application is for building DSTs.
Be aware of the following caveats:
Referenced by TestFactoryFlag().