| The Gaudi Framework v28r2p1 (f1a77ff4)

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

- File List
- File Members

AnyDataWrapper.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_ANYDATAWRAPPER_H
2 #define GAUDIKERNEL_ANYDATAWRAPPER_H
3
4 //Include files
5 #include "GaudiKernel/DataObject.h"
6
7 struct GAUDI_API AnyDataWrapperBase : DataObject {
8 // ugly hack to circumvent the usage of boost::any yet
9 // DataSvc would need a templated register method
10 virtual ~AnyDataWrapperBase(){};
11 };
12
13 template<class T>
14 class GAUDI_API AnyDataWrapper final : public AnyDataWrapperBase {
15 public:
16
17 AnyDataWrapper(T&& data)
18 : m_data(std::move(data))
19 {};
20
21 AnyDataWrapper(AnyDataWrapper&& other)
22 : AnyDataWrapperBase(std::move(other) )
23 , m_data(std::move(other.m_data))
24 {};
25
26 const T& getData() const {return m_data;}
27 T& getData() {return m_data;}
28
29 private:
30 T m_data;
31 };
32
33 #endif
AnyDataWrapperBase
Definition: AnyDataWrapper.h:7
std
STL namespace.
AnyDataWrapper::getData
const T & getData() const
Definition: AnyDataWrapper.h:26
AnyDataWrapper::AnyDataWrapper
AnyDataWrapper(AnyDataWrapper &&other)
Definition: AnyDataWrapper.h:21
AnyDataWrapper
Definition: AnyDataWrapper.h:14
AnyDataWrapperBase::~AnyDataWrapperBase
virtual ~AnyDataWrapperBase()
Definition: AnyDataWrapper.h:10
AnyDataWrapper::m_data
T m_data
Definition: AnyDataWrapper.h:30
AnyDataWrapper::AnyDataWrapper
AnyDataWrapper(T &&data)
Definition: AnyDataWrapper.h:17
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
AnyDataWrapper::getData
T & getData()
Definition: AnyDataWrapper.h:27
DataObject.h