Belle II Software development
StoreWrapper.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10#include <framework/datastore/RelationsObject.h>
11
12namespace Belle2 {
17
18 namespace TrackFindingCDC {
19
28 template<class T>
30
31 public:
33 const T& get() const
34 { return m_item; }
35
37 T& get()
38 { return m_item; }
39
41 T& unwrap()
42 { return m_item; }
43
45 T* operator->() { return &m_item; }
46
48 const T* operator->() const { return &m_item; }
49
51 T& operator*() { return m_item; }
52
54 const T& operator*() const { return m_item; }
55
57 const T& __iter__() const { return m_item; }
58
59 public:
62
63 private:
66 };
67
68 }
69
71}
72
73
This template functions as a wrapper for objects that do not inherit from TObject to be put on the Da...
T m_item
Memory for the wrapped item.
const T & operator*() const
Unpacks the wrapped object as if the wrapper was a pointer to it.
T & operator*()
Unpacks the wrapped object as if the wrapper was a pointer to it.
T * operator->()
Forwarding -> access to the wrapped object as if the wrapper would be a pointer to it.
const T & __iter__() const
Forwards an iteration request from python to the wrapped object. If iteration is feasible depends on ...
const T & get() const
Constant getter for the the contained object.
const T * operator->() const
Forwarding -> access to the wrapped object as if the wrapper would be a pointer to it.
ClassDef(StoreWrapper, 1)
ROOT Macro to unconditionally make StoreWrapper a ROOT class.
T & unwrap()
Alias getter for the the contained object to stress that the wrapper is being removed.
T & get()
Getter for the the contained object.
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Abstract base class for different kinds of events.