| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

AnyDataHandle.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_ANYDATAHANDLE_H
2 #define GAUDIKERNEL_ANYDATAHANDLE_H
3
4 #include "GaudiKernel/AnyDataWrapper.h"
5 #include <GaudiKernel/DataObjectHandle.h>
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
16 using DataObjectHandle<AnyDataWrapper<T>>::DataObjectHandle;
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 {
34 auto doh = DataObjectHandle<AnyDataWrapper<T>>::get();
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
AnyDataHandle
Definition: AnyDataHandle.h:14
AnyDataWrapper.h
AnyDataHandle::put
const T * put(T &&object)
Register object in transient store.
Definition: AnyDataHandle.h:41
DataObjectHandle
DataObjectHandle.h GaudiKernel/DataObjectHandle.h.
Definition: AlgTool.h:27
AnyDataWrapper
Definition: AnyDataWrapper.h:14
std::move
T move(T...args)
AnyDataHandle::get
const T * get() const
Retrieve object from transient data store.
Definition: AnyDataHandle.h:32
DataObjectHandle.h