Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test13.cc File Reference
#include <iostream>
#include <boost/python.hpp>
Include dependency graph for test13.cc:

Go to the source code of this file.

Functions

intalloc_int ()
 
void operate_list (int vec[10])
 
list f_alloc_int ()
 
void f_operate_list (list &alist)
 
 BOOST_PYTHON_MODULE (test13)
 

Function Documentation

int* alloc_int ( )

Definition at line 36 of file test13.cc.

37 {
38  int* intlist= new int [10];
39  for (int i=0; i<10; i++) intlist[i]= 0;
40 
41  return intlist;
42 }

Here is the caller graph for this function:

BOOST_PYTHON_MODULE ( test13  )

Definition at line 86 of file test13.cc.

87 {
88  def("alloc_int", f_alloc_int);
89  def("operate_list", f_operate_list);
90 }
void f_operate_list(list &alist)
Definition: test13.cc:70
list f_alloc_int()
Definition: test13.cc:59

Here is the call graph for this function:

list f_alloc_int ( )

Definition at line 59 of file test13.cc.

60 {
61  int* aaa= alloc_int();
62  int n= 10;
63  list x;
64  for(int i=0; i<n; i++) {
65  x.append(aaa[i]);
66  }
67  return x;
68 }
tuple x
Definition: test.py:50
int * alloc_int()
Definition: test13.cc:36
const G4int n

Here is the call graph for this function:

Here is the caller graph for this function:

void f_operate_list ( list &  alist)

Definition at line 70 of file test13.cc.

71 {
72  int* intlist= new int [10];
73  for (int i=0; i<10; i++) {
74  intlist[i]= extract<int>(alist[i]);
75  }
76 
77  operate_list(intlist);
78 
79  for (int i=0; i<10; i++) {
80  alist[i]= intlist[i];
81  }
82 
83  delete intlist;
84 }
void operate_list(int vec[10])
Definition: test13.cc:45
tuple alist
Definition: test.py:9

Here is the call graph for this function:

Here is the caller graph for this function:

void operate_list ( int  vec[10])

Definition at line 45 of file test13.cc.

46 {
47  for(int i=0; i<10; i++) {
48  std::cout << vec[i] << std::endl;
49  vec[i]++;
50  }
51 }

Here is the caller graph for this function: