The Gaudi Framework  v29r0 (ff2e7097)
AnyDataHandle.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_ANYDATAHANDLE_H
2 #define GAUDIKERNEL_ANYDATAHANDLE_H
3 
6 
7 // TODO: we should derive directly from DataObjectHandleBase
8 // now that that is sufficient to get all the declareProperty
9 // stuff done... (thanks to the SFINAE constraints in
10 // Algortihm and AlgTool!)
11 // And then we can avoid any confusion with the DataObjectHandle
12 // interface.
13 template <typename T>
14 struct AnyDataHandle final : public DataObjectHandle<AnyDataWrapper<T>> {
15 
17 
21  const T* get() const;
22 
26  const T* put( T&& object );
27 };
28 
29 //---------------------------------------------------------------------------
30 
31 template <typename T>
32 const T* AnyDataHandle<T>::get() const
33 {
35  return &( doh->getData() );
36 }
37 
38 //---------------------------------------------------------------------------
39 
40 template <typename T>
41 const T* AnyDataHandle<T>::put( T&& objectp )
42 {
43  auto dw = new AnyDataWrapper<T>( std::move( objectp ) );
44  return &DataObjectHandle<AnyDataWrapper<T>>::put( dw )->getData();
45 }
46 
47 #endif
const T * put(T &&object)
Register object in transient store.
Definition: AnyDataHandle.h:41
DataObjectHandle.h GaudiKernel/DataObjectHandle.h.
Definition: AlgTool.h:27
T move(T...args)
const T * get() const
Retrieve object from transient data store.
Definition: AnyDataHandle.h:32