LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
test12.cc File Reference
#include <boost/python.hpp>
#include "vector_indexing_suite.hpp"
#include <vector>
#include <iostream>

Go to the source code of this file.

Classes

class  AClass
 

Typedefs

typedef std::vector< AClass * > AVector
 

Functions

void PrintVector (const AVector &vec)
 
 BOOST_PYTHON_MODULE (test12)
 

Typedef Documentation

typedef std::vector<AClass*> AVector

Definition at line 68 of file test12.cc.

Function Documentation

BOOST_PYTHON_MODULE ( test12  )

Definition at line 83 of file test12.cc.

References AClass::GetIVal(), AClass::Print(), PrintVector(), and AClass::SetIVal().

84 {
85  class_<AClass, AClass*>("AClass", "a class")
86  .add_property("ival", &AClass::GetIVal, &AClass::SetIVal)
87  .def("Print", &AClass::Print)
88  ;
89 
90  class_<AVector> ("AVector", "AClass vector")
92  ;
93 
94  def("PrintVector", PrintVector);
95 }
int GetIVal() const
Definition: AClass.hh:66
void Print() const
Definition: test12.cc:61
void PrintVector(const AVector &vec)
Definition: test12.cc:71
void SetIVal(int i)
Definition: AClass.hh:65
void PrintVector ( const AVector vec)

Definition at line 71 of file test12.cc.

References AClass::Print().

Referenced by BOOST_PYTHON_MODULE().

71  {
72  std::cout << "*** size of AVector= " << vec.size() << std::endl;
73  for (int i=0; i< vec.size(); i++) {
74  vec[i]-> Print();
75  }
76 }
void Print(G4Element &ele)
Definition: pyG4Element.cc:55