ATLAS Offline Software
Loading...
Searching...
No Matches
RootUtils::PyBytes Class Reference

#include <PyROOTTFilePythonize.h>

Collaboration diagram for RootUtils::PyBytes:

Public Member Functions

 PyBytes (size_t buf_sz=0)
 wrapper around char* to explicitly mean bytes.
 ~PyBytes ()
 PyBytes (const PyBytes &rhs)
PyBytesoperator= (const PyBytes &rhs)
void * buffer () const
 After we drop py2, we can simplify the code in PyUtils.RootUtils.py by just returning a bytes object from here.

Public Attributes

size_t sz
 the size of the buffer of bytes
std::vector< char > buf
 the buffer of bytes

Detailed Description

Definition at line 30 of file PyROOTTFilePythonize.h.

Constructor & Destructor Documentation

◆ PyBytes() [1/2]

RootUtils::PyBytes::PyBytes ( size_t buf_sz = 0)

wrapper around char* to explicitly mean bytes.

Parameters
buf_szThe size of the buffer (in bytes)

Definition at line 22 of file PyROOTTFilePythonize.cxx.

22 :
23 sz(buf_sz>0?buf_sz:0),
24 buf(sz)
25{
26}
std::vector< char > buf
the buffer of bytes
size_t sz
the size of the buffer of bytes

◆ ~PyBytes()

RootUtils::PyBytes::~PyBytes ( )

Definition at line 28 of file PyROOTTFilePythonize.cxx.

29{
30}

◆ PyBytes() [2/2]

RootUtils::PyBytes::PyBytes ( const PyBytes & rhs)

Definition at line 32 of file PyROOTTFilePythonize.cxx.

32 :
33 sz(rhs.sz),
34 buf(rhs.buf)
35{
36}

Member Function Documentation

◆ buffer()

void * RootUtils::PyBytes::buffer ( ) const
inline

After we drop py2, we can simplify the code in PyUtils.RootUtils.py by just returning a bytes object from here.

Definition at line 59 of file PyROOTTFilePythonize.h.

59{ return (void*)buf.data(); }

◆ operator=()

PyBytes & RootUtils::PyBytes::operator= ( const PyBytes & rhs)

Definition at line 39 of file PyROOTTFilePythonize.cxx.

40{
41 if (this != &rhs) {
42 this->sz = rhs.sz;
43 this->buf = rhs.buf;
44 }
45 return *this;
46}

Member Data Documentation

◆ buf

std::vector<char> RootUtils::PyBytes::buf

the buffer of bytes

Definition at line 53 of file PyROOTTFilePythonize.h.

◆ sz

size_t RootUtils::PyBytes::sz

the size of the buffer of bytes

Definition at line 49 of file PyROOTTFilePythonize.h.


The documentation for this class was generated from the following files: