Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Typedefs | Functions
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.

Data Structures

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 }
void SetIVal(int i)
void PrintVector(const AVector &vec)
Definition: test12.cc:72
int GetIVal() const
void Print() const
Definition: test12.cc:62
void PrintVector ( const AVector vec)

Definition at line 72 of file test12.cc.

References pyG4Element::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