Geant4  10.00.p02
pyG4Isotope.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: pyG4Isotope.cc 76884 2013-11-18 12:54:03Z gcosmo $
27 // ====================================================================
28 // pyG4Isotope.cc
29 //
30 // 2005 Q
31 // ====================================================================
32 #include <boost/python.hpp>
33 #include "G4Version.hh"
34 #include "pyG4indexing.hh"
35 #include "G4Isotope.hh"
36 
37 using namespace boost::python;
38 
39 // ====================================================================
40 // thin wrappers
41 // ====================================================================
42 namespace pyG4Isotope {
43 
45 
46 // copy constructor is private, so ...
47 void Print(G4Isotope& iso)
48 {
49  G4cout << iso;
50 }
51 
52 }
53 
54 using namespace pyG4Isotope;
55 
56 // ====================================================================
57 // module definition
58 // ====================================================================
60 {
61  class_<G4Isotope, G4Isotope*, boost::noncopyable>
62  ("G4Isotope", "isotope class", no_init)
63  // constructors
64  .def(init<const G4String&, G4int, G4int>())
65  .def(init<const G4String&, G4int, G4int, G4double>())
66  // ---
67  .def("GetName", &G4Isotope::GetName,
68  return_value_policy<reference_existing_object>())
69  .def("SetName", &G4Isotope::SetName)
70  .def("GetZ", &G4Isotope::GetZ)
71  .def("GetN", &G4Isotope::GetN)
72  .def("GetA", &G4Isotope::GetA)
73  .def("GetIsotope", &G4Isotope::GetIsotope,
74  f_GetIsotope()
75  [return_value_policy<reference_existing_object>()])
76  .staticmethod("GetIsotope")
77  .def("GetIsotopeTable", &G4Isotope::GetIsotopeTable,
78  return_value_policy<reference_existing_object>())
79  .staticmethod("GetIsotopeTable")
80  .def("GetNumberOfIsotopes", &G4Isotope::GetNumberOfIsotopes)
81  .staticmethod("GetNumberOfIsotopes")
82 
83  .def("GetIndex", &G4Isotope::GetIndex)
84  // ---
85  .def("Print", Print)
86  .def(self == self)
87  .def(self != self)
88  ;
89 
90  // G4IsotopeTable
91  class_<G4IsotopeTable> ("G4IsotopeTable", "isotope table")
92  .def(vector_indexing_suite<G4IsotopeTable>())
93  .def(self_ns::str(self))
94  ;
95 }
G4double GetA() const
Definition: G4Isotope.hh:97
const G4String & GetName() const
Definition: G4Isotope.hh:88
BOOST_PYTHON_FUNCTION_OVERLOADS(f_func2, func2, 1, 2)
void SetName(const G4String &name)
Definition: G4Isotope.hh:134
static const G4IsotopeTable * GetIsotopeTable()
Definition: G4Isotope.cc:182
static G4Isotope * GetIsotope(const G4String &name, G4bool warning=false)
Definition: G4Isotope.cc:196
G4int GetN() const
Definition: G4Isotope.hh:94
G4GLOB_DLL std::ostream G4cout
size_t GetIndex() const
Definition: G4Isotope.hh:113
void Print(G4Isotope &iso)
Definition: pyG4Isotope.cc:47
G4int GetZ() const
Definition: G4Isotope.hh:91
static size_t GetNumberOfIsotopes()
Definition: G4Isotope.cc:189
void export_G4Isotope()
Definition: pyG4Isotope.cc:59