Loading [MathJax]/jax/output/HTML-CSS/config.js
The Gaudi Framework  v28r2p1 (f1a77ff4)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
32 template<typename T>
33 const T* AnyDataHandle<T>::get() const {
35  return &(doh->getData());
36 }
37 
38 //---------------------------------------------------------------------------
39 
40 template<typename T>
41 const T* AnyDataHandle<T>::put (T&& objectp){
42  auto dw = new AnyDataWrapper<T>(std::move(objectp));
43  return &DataObjectHandle<AnyDataWrapper<T> >::put(dw)->getData();
44 }
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:33