ATLAS Offline Software
Loading...
Searching...
No Matches
PyROOTTFilePythonize.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4*/
13
14
15#ifndef ROOTUTILS_PYROOTTFILEPYTHONIZE_H
16#define ROOTUTILS_PYROOTTFILEPYTHONIZE_H 1
17
18// standard includes
19#include <inttypes.h> //> for size_t
20
21// ROOT includes
22#include "TFile.h"
23
24// forward declarations
25
26
27namespace RootUtils {
28
29
31{
32public:
37 PyBytes(size_t buf_sz=0);
38
39 ~PyBytes();
40
41 PyBytes(const PyBytes& rhs);
42
43 PyBytes& operator=(const PyBytes& rhs);
44
45 // data members
46
49 size_t sz;
50
53 std::vector<char> buf;
54
59 void* buffer() const { return (void*)buf.data(); }
60
61};
62
65PyBytes _pythonize_read_root_file(TFile* f, Int_t len);
66
69Long64_t _pythonize_tell_root_file(TFile* f);
70
71} // namespace RootUtils
72
73
74#endif // not ROOTUTILS_PYROOTTFILEPYTHONIZE_H
PyBytes & operator=(const PyBytes &rhs)
std::vector< char > buf
the buffer of bytes
size_t sz
the size of the buffer of bytes
PyBytes(size_t buf_sz=0)
wrapper around char* to explicitly mean bytes.
void * buffer() const
After we drop py2, we can simplify the code in PyUtils.RootUtils.py by just returning a bytes object ...
PyBytes _pythonize_read_root_file(TFile *f, Int_t len)
read len bytes from file f
Long64_t _pythonize_tell_root_file(TFile *f)
tell the current position in file f