The Gaudi Framework  master (d4ee5f7d)
Loading...
Searching...
No Matches
BranchReadHelper.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
12
14#include <TBranch.h>
15#include <gsl/pointers>
16#include <memory>
17
31
32namespace Gaudi::details {
33
34 class BranchReadHelper final {
35 public:
36 explicit BranchReadHelper( gsl::not_null<TBranch*> b );
37 BranchReadHelper( const BranchReadHelper& other ) = delete;
38 BranchReadHelper& operator=( const BranchReadHelper& other ) = delete;
39 BranchReadHelper( BranchReadHelper&& other ) noexcept;
40 BranchReadHelper& operator=( BranchReadHelper&& other ) noexcept;
41
42 std::unique_ptr<DataObject> adoptValue();
43
45
46 private:
47 TBranch* m_branch{ nullptr };
48 void* m_store{ nullptr };
49
50 DataObject* ( *m_extractor )( void* ) = nullptr;
51 };
52
53} // namespace Gaudi::details
A DataObject is the base class of any identifiable object on any data store.
Definition DataObject.h:37
BranchReadHelper(const BranchReadHelper &other)=delete
BranchReadHelper & operator=(const BranchReadHelper &other)=delete
BranchReadHelper(gsl::not_null< TBranch * > b)
std::unique_ptr< DataObject > adoptValue()
Helper for type agnostic reading of data in branches.
Definition Algorithm.h:16