JANA2
C++ framework for multi-threaded data processing
Loading...
Searching...
No Matches
JLightweightDatabundleT< T > Class Template Reference
Inheritance diagram for JLightweightDatabundleT< T >:
[legend]
Collaboration diagram for JLightweightDatabundleT< T >:
[legend]

Public Member Functions

 JLightweightDatabundleT (std::vector< T * > *external_data=nullptr)
 
void ClearData () override
 
size_t GetSize () const override
 
std::vector< T * > & GetData ()
 
void SetPersistentFlag (bool persistent)
 
void SetNotOwnerFlag (bool not_owner)
 
bool GetPersistentFlag ()
 
bool GetNotOwnerFlag ()
 
template<typename S >
void EnableGetAs ()
 EnableGetAs generates a vtable entry so that users may extract the contents of this JFactoryT from the type-erased JFactory.
 
template<typename S >
void EnableGetAs (std::true_type)
 
template<typename S >
void EnableGetAs (std::false_type)
 
- Public Member Functions inherited from JDatabundle
 JDatabundle (const JDatabundle &other)
 
Status GetStatus () const
 
std::string GetUniqueName () const
 
std::string GetShortName () const
 
bool HasShortName () const
 
std::string GetTypeName () const
 
std::type_index GetTypeIndex () const
 
JCallGraphRecorder::JDataOrigin GetInsertOrigin () const
 If objects were placed here by JEvent::Insert() this records whether that call was made from a source or factory.
 
JFactoryGetFactory () const
 
void SetStatus (Status s)
 
void SetUniqueName (std::string unique_name)
 
void SetShortName (std::string short_name)
 
void SetTypeName (std::string type_name)
 
void SetTypeIndex (std::type_index index)
 
void SetInsertOrigin (JCallGraphRecorder::JDataOrigin origin)
 Called automatically by JEvent::Insert() to records whether that call was made by a source or factory.
 
void SetFactory (JFactory *fac)
 
template<typename S >
std::vector< S * > GetAs ()
 Generically access the encapsulated data, performing an upcast if necessary.
 

Additional Inherited Members

- Public Types inherited from JDatabundle
enum class  Status {
  Empty ,
  Created ,
  Inserted ,
  Excepted
}
 
- Protected Attributes inherited from JDatabundle
std::unordered_map< std::type_index, std::unique_ptr< JAny > > mUpcastVTable
 

Member Function Documentation

◆ ClearData()

template<typename T >
void JLightweightDatabundleT< T >::ClearData ( )
overridevirtual

Implements JDatabundle.

◆ EnableGetAs()

template<typename T >
template<typename S >
void JLightweightDatabundleT< T >::EnableGetAs ( )

EnableGetAs generates a vtable entry so that users may extract the contents of this JFactoryT from the type-erased JFactory.

The user has to manually specify which upcasts to allow, and they have to do so for each instance. It is recommended to do so in the constructor. Note that EnableGetAs<T>() is called automatically.

◆ GetSize()

template<typename T >
size_t JLightweightDatabundleT< T >::GetSize ( ) const
inlineoverridevirtual

Implements JDatabundle.


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