JANA2
JFactorySet Class Reference
Inheritance diagram for JFactorySet:
Collaboration diagram for JFactorySet:

Public Member Functions

 JFactorySet (const std::vector< JFactoryGenerator * > &aFactoryGenerators)
 
virtual ~JFactorySet ()
 
bool Add (JFactory *aFactory)
 
void Merge (JFactorySet &aFactorySet)
 
void Print (void) const
 
void Release (void)
 Release() loops over all contained factories, clearing their data.
 
JFactoryGetFactory (std::type_index aObjectType, const std::string &aFactoryTag="") const
 
template<typename T >
JFactoryT< T > * GetFactory (const std::string &tag="") const
 
std::vector< JFactory * > GetAll () const
 
template<typename T >
std::vector< JFactoryT< T > * > GetFactoryAll () const
 
std::vector< JFactorySummarySummarize () const
 Summarize() generates a JFactorySummary data object describing each JFactory that this JFactorySet contains. More...
 
- Public Member Functions inherited from JResettable
virtual void Reset (void)
 

Protected Attributes

std::map< std::pair< std::type_index, std::string >, JFactory * > mFactories
 

Constructor & Destructor Documentation

JFactorySet::~JFactorySet ( )
virtual

The destructor will delete any factories in the set.

Member Function Documentation

bool JFactorySet::Add ( JFactory aFactory)

Add a JFactory to this JFactorySet. The JFactorySet assumes ownership of this factory. If the JFactorySet already contains a JFactory with the same key, throw an exception and let the user figure out what to do. This scenario occurs when the user has multiple JFactory<T> producing the same T JObject, and is not distinguishing between them via tags.

Referenced by JEvent::Insert().

Here is the caller graph for this function:

void JFactorySet::Merge ( JFactorySet aFactorySet)

Merge any factories in the specified JFactorySet into this one. Any factories which don't have the same type and tag as one already in this set will be transferred and this JFactorySet will take ownership of them. Ones that have a type and tag that matches one already in this set will be left in the original JFactorySet. Thus, all factories left in the JFactorySet passed into this method upon return from it can be considered duplicates. It will be left to the caller to delete those.

std::vector< JFactorySummary > JFactorySet::Summarize ( ) const

Summarize() generates a JFactorySummary data object describing each JFactory that this JFactorySet contains.

The data is extracted from the JFactory itself.


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