DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Private Attributes | List of all members
dd4hep::sim::Geant4PythonCall Class Reference

Base class to initialize a multi-threaded or single threaded Geant4 application. More...

#include <Geant4PythonCall.h>

Public Member Functions

 Geant4PythonCall ()
 Standard constructor. More...
 
virtual ~Geant4PythonCall ()
 Default destructor. More...
 
bool isValid () const
 Check if call is set. More...
 
template<typename RETURN >
RETURN execute () const
 Execute command in the python interpreter. More...
 
template<typename RETURN >
RETURN execute (PyObject *callable) const
 Execute command in the python interpreter. More...
 
template<typename RETURN >
RETURN execute (PyObject *callable, PyObject *args) const
 Execute command in the python interpreter. More...
 
void set (PyObject *callable, PyObject *args)
 Set the callback structures for callbacks with arguments. More...
 
void set (PyObject *callable)
 Set the callback structures for callbacks without arguments. More...
 

Private Attributes

PyObject * m_callable
 Python callable reference. More...
 
PyObject * m_arguments
 Python arguments object. More...
 

Detailed Description

Base class to initialize a multi-threaded or single threaded Geant4 application.

Author
M.Frank
Version
1.0

Definition at line 32 of file Geant4PythonCall.h.

Constructor & Destructor Documentation

◆ Geant4PythonCall()

Geant4PythonCall::Geant4PythonCall ( )

Standard constructor.

Standard constructor, initializes variables.

Definition at line 23 of file Geant4PythonCall.cpp.

◆ ~Geant4PythonCall()

Geant4PythonCall::~Geant4PythonCall ( )
virtual

Default destructor.

Definition at line 29 of file Geant4PythonCall.cpp.

Member Function Documentation

◆ execute() [1/3]

template<typename RETURN >
RETURN dd4hep::sim::Geant4PythonCall::execute

Execute command in the python interpreter.

Definition at line 52 of file Geant4PythonCall.cpp.

◆ execute() [2/3]

template<typename RETURN >
RETURN dd4hep::sim::Geant4PythonCall::execute ( PyObject *  callable) const

Execute command in the python interpreter.

Definition at line 59 of file Geant4PythonCall.cpp.

◆ execute() [3/3]

template<typename RETURN >
RETURN dd4hep::sim::Geant4PythonCall::execute ( PyObject *  callable,
PyObject *  args 
) const

Execute command in the python interpreter.

Definition at line 66 of file Geant4PythonCall.cpp.

◆ isValid()

bool dd4hep::sim::Geant4PythonCall::isValid ( ) const
inline

Check if call is set.

Definition at line 45 of file Geant4PythonCall.h.

◆ set() [1/2]

void Geant4PythonCall::set ( PyObject *  callable)

Set the callback structures for callbacks without arguments.

Definition at line 43 of file Geant4PythonCall.cpp.

◆ set() [2/2]

void Geant4PythonCall::set ( PyObject *  callable,
PyObject *  args 
)

Set the callback structures for callbacks with arguments.

Definition at line 36 of file Geant4PythonCall.cpp.

Member Data Documentation

◆ m_arguments

PyObject* dd4hep::sim::Geant4PythonCall::m_arguments
private

Python arguments object.

Definition at line 36 of file Geant4PythonCall.h.

◆ m_callable

PyObject* dd4hep::sim::Geant4PythonCall::m_callable
private

Python callable reference.

Definition at line 34 of file Geant4PythonCall.h.


The documentation for this class was generated from the following files: