ATLAS Offline Software
Static Public Member Functions | List of all members
Py::cnv< std::vector< T > > Struct Template Reference

#include <PyDataStore.h>

Collaboration diagram for Py::cnv< std::vector< T > >:

Static Public Member Functions

static Py::Object to (const std::vector< T > &t)
 
static PyObjecttoPy (const std::vector< T > &t)
 

Detailed Description

template<typename T>
struct Py::cnv< std::vector< T > >

Definition at line 35 of file PyDataStore.h.

Member Function Documentation

◆ to()

template<typename T >
static Py::Object Py::cnv< std::vector< T > >::to ( const std::vector< T > &  t)
inlinestatic

Definition at line 37 of file PyDataStore.h.

38  {
39  Py::Tuple o( t.size() );
40  for ( std::size_t i = 0, iMax = t.size(); i != iMax; ++i ) {
41  o[i] = cnv<T>::to(t[i]);
42  }
43  return o;
44  }

◆ toPy()

template<typename T >
static PyObject* Py::cnv< std::vector< T > >::toPy ( const std::vector< T > &  t)
inlinestatic

Definition at line 65 of file PyStoreCnvUtils.h.

66  {
67  const std::size_t iMax = t.size();
68  PyObject* o = PyList_New( iMax );
69  if ( !o ) {
70  Py_XDECREF( o );
71  Py_INCREF( Py_None );
72  return Py_None;
73  }
74  for ( std::size_t i = 0; i < iMax; ++i ){
75  PyList_SET_ITEM( o, i, Py::cnv<T>::toPy( t[i] ) );
76  }
77  return o;
78  }

The documentation for this struct was generated from the following files:
Py::cnv::to
static Py::Object to(CxxType t)
Definition: PyDataStore.h:30
Py::cnv
helper method to convert a type to a Py::Object
Definition: PyDataStore.h:28
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
lumiFormat.i
int i
Definition: lumiFormat.py:92
PyObject
_object PyObject
Definition: IPyComponent.h:26
Tuple
PerfMon::Tuple Tuple
Definition: PerfMonSvc.cxx:91