| The Gaudi Framework v29r0 (ff2e7097)

- 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 {
16 public:
17 AnyDataWrapper( T&& data ) : m_data( std::move( data ) ){};
18
19 AnyDataWrapper( AnyDataWrapper&& other )
20 : AnyDataWrapperBase( std::move( other ) ), m_data( std::move( other.m_data ) ){};
21
22 const T& getData() const { return m_data; }
23 T& getData() { return m_data; }
24
25 private:
26 T m_data;
27 };
28
29 #endif
AnyDataWrapperBase
Definition: AnyDataWrapper.h:7
std
STL namespace.
AnyDataWrapper::getData
const T & getData() const
Definition: AnyDataWrapper.h:22
AnyDataWrapper::AnyDataWrapper
AnyDataWrapper(AnyDataWrapper &&other)
Definition: AnyDataWrapper.h:19
AnyDataWrapper
Definition: AnyDataWrapper.h:14
AnyDataWrapperBase::~AnyDataWrapperBase
virtual ~AnyDataWrapperBase()
Definition: AnyDataWrapper.h:10
AnyDataWrapper::m_data
T m_data
Definition: AnyDataWrapper.h:26
AnyDataWrapper::AnyDataWrapper
AnyDataWrapper(T &&data)
Definition: AnyDataWrapper.h:17
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
AnyDataWrapper::getData
T & getData()
Definition: AnyDataWrapper.h:23
DataObject.h