LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 69 of file test12.cc.

Function Documentation

BOOST_PYTHON_MODULE ( test12  )

Definition at line 84 of file test12.cc.

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

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

Definition at line 72 of file test12.cc.

References AClass::Print().

Referenced by BOOST_PYTHON_MODULE().

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