Geant4-11
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// ====================================================================
27// pyG4Isotope.cc
28//
29// 2005 Q
30// ====================================================================
31#include <boost/python.hpp>
32#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
33#include "G4Version.hh"
34#include "G4Isotope.hh"
35
36using namespace boost::python;
37
38// ====================================================================
39// thin wrappers
40// ====================================================================
41namespace pyG4Isotope {
42
44
45// copy constructor is private, so ...
46void Print(G4Isotope& iso)
47{
48 G4cout << iso;
49}
50
51}
52
53using namespace pyG4Isotope;
54
55// ====================================================================
56// module definition
57// ====================================================================
59{
60 class_<G4Isotope, G4Isotope*, boost::noncopyable>
61 ("G4Isotope", "isotope class", no_init)
62 // constructors
63 .def(init<const G4String&, G4int, G4int>())
64 .def(init<const G4String&, G4int, G4int, G4double>())
65 // ---
66 .def("GetName", &G4Isotope::GetName,
67 return_value_policy<reference_existing_object>())
68 .def("SetName", &G4Isotope::SetName)
69 .def("GetZ", &G4Isotope::GetZ)
70 .def("GetN", &G4Isotope::GetN)
71 .def("GetA", &G4Isotope::GetA)
72 .def("GetIsotope", &G4Isotope::GetIsotope,
73 f_GetIsotope()
74 [return_value_policy<reference_existing_object>()])
75 .staticmethod("GetIsotope")
76 .def("GetIsotopeTable", &G4Isotope::GetIsotopeTable,
77 return_value_policy<reference_existing_object>())
78 .staticmethod("GetIsotopeTable")
79 .def("GetNumberOfIsotopes", &G4Isotope::GetNumberOfIsotopes)
80 .staticmethod("GetNumberOfIsotopes")
81
82 .def("GetIndex", &G4Isotope::GetIndex)
83 // ---
84 .def("Print", Print)
85 .def(self == self)
86 .def(self != self)
87 ;
88
89 // G4IsotopeTable
90 class_<G4IsotopeTable> ("G4IsotopeTable", "isotope table")
91 .def(vector_indexing_suite<G4IsotopeTable>())
92 .def(self_ns::str(self))
93 ;
94}
G4GLOB_DLL std::ostream G4cout
size_t GetIndex() const
Definition: G4Isotope.hh:110
static const G4IsotopeTable * GetIsotopeTable()
Definition: G4Isotope.cc:181
G4int GetZ() const
Definition: G4Isotope.hh:90
void SetName(const G4String &name)
Definition: G4Isotope.hh:131
static size_t GetNumberOfIsotopes()
Definition: G4Isotope.cc:188
static G4Isotope * GetIsotope(const G4String &name, G4bool warning=false)
Definition: G4Isotope.cc:195
G4int GetN() const
Definition: G4Isotope.hh:93
const G4String & GetName() const
Definition: G4Isotope.hh:87
G4double GetA() const
Definition: G4Isotope.hh:96
void Print(G4Isotope &iso)
Definition: pyG4Isotope.cc:46
BOOST_PYTHON_FUNCTION_OVERLOADS(g_GetProcessVector, f_GetProcessVector, 2, 3) list f_GetAtRestProcessVector(const G4ProcessManager *procMgr
void export_G4Isotope()
Definition: pyG4Isotope.cc:58