Project
Loading...
Searching...
No Matches
o2::framework::ROOTSerialized< T, HintType > Class Template Reference

#include <SerializationMethods.h>

Public Types

using non_messageable = o2::framework::MarkAsNonMessageable
 
using wrapped_type = T
 
using hint_type = HintType
 

Public Member Functions

 ROOTSerialized ()=delete
 
 ROOTSerialized (wrapped_type &ref, hint_type *hint=nullptr)
 
T & operator() ()
 
T const & operator() () const
 
hint_typegetHint () const
 

Detailed Description

template<typename T, typename HintType = void>
class o2::framework::ROOTSerialized< T, HintType >

Enforce ROOT serialization for a type

Usage: (with 'output' being the DataAllocator of the ProcessingContext) SomeType object; ROOTSerialized<decltype(object)> ref(object); output.snapshot(Output{}, ref);

  • or - output.snapshot(Output{}, ROOTSerialized<decltype(object)>(object));

The existence of the ROOT dictionary for the wrapped type can not be checked at compile time, a runtime check must be performed in the substitution for the ROOTSerialized type.

An optional hint can be passed to point to the class info, supported types are TClass or const char. A pointer of the hint can be passed to the constructor in addition to the reference. In the first case, the TClass instance will be used directly (faster) while in the latter the TClass registry is searched by name. TClass* classinfo = ...; ROOTSerialized<decltype(object), TClass>(object, classinfo));

  • or - ROOTSerialized<decltype(object), const char>(object, "classname"));

Definition at line 46 of file SerializationMethods.h.

Member Typedef Documentation

◆ hint_type

template<typename T , typename HintType = void>
using o2::framework::ROOTSerialized< T, HintType >::hint_type = HintType

Definition at line 51 of file SerializationMethods.h.

◆ non_messageable

template<typename T , typename HintType = void>
using o2::framework::ROOTSerialized< T, HintType >::non_messageable = o2::framework::MarkAsNonMessageable

Definition at line 49 of file SerializationMethods.h.

◆ wrapped_type

template<typename T , typename HintType = void>
using o2::framework::ROOTSerialized< T, HintType >::wrapped_type = T

Definition at line 50 of file SerializationMethods.h.

Constructor & Destructor Documentation

◆ ROOTSerialized() [1/2]

template<typename T , typename HintType = void>
o2::framework::ROOTSerialized< T, HintType >::ROOTSerialized ( )
delete

◆ ROOTSerialized() [2/2]

template<typename T , typename HintType = void>
o2::framework::ROOTSerialized< T, HintType >::ROOTSerialized ( wrapped_type ref,
hint_type hint = nullptr 
)
inline

Definition at line 57 of file SerializationMethods.h.

Member Function Documentation

◆ getHint()

template<typename T , typename HintType = void>
hint_type * o2::framework::ROOTSerialized< T, HintType >::getHint ( ) const
inline

Definition at line 62 of file SerializationMethods.h.

◆ operator()() [1/2]

template<typename T , typename HintType = void>
T & o2::framework::ROOTSerialized< T, HintType >::operator() ( )
inline

Definition at line 59 of file SerializationMethods.h.

◆ operator()() [2/2]

template<typename T , typename HintType = void>
T const & o2::framework::ROOTSerialized< T, HintType >::operator() ( ) const
inline

Definition at line 60 of file SerializationMethods.h.


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