OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C > Struct Template Reference

Helper class to handle setting Attributes from python. More...

#include <PyOpalObject.h>

Inherits boost::python::default_call_policies.

Collaboration diagram for PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >:
Collaboration graph

Public Member Functions

 PyOpalObjectSetProperty (AttributeType type, std::string opalName)
 Constructor. More...
 
 ~PyOpalObjectSetProperty ()
 destructor More...
 
template<class ArgumentPackage >
PyObject * postcall (ArgumentPackage const &args, PyObject *result)
 postcall action More...
 

Static Public Member Functions

static void setObject (PyOpalObject< C > *object)
 Set pointer to the element; should be called before each postcall. More...
 

Private Attributes

AttributeType type_m
 
std::string opalName_m
 

Static Private Attributes

static PyOpalObject< C > * object_m = nullptr
 

Detailed Description

template<class C>
struct PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >

Helper class to handle setting Attributes from python.

Definition at line 440 of file PyOpalObject.h.

Constructor & Destructor Documentation

◆ PyOpalObjectSetProperty()

template<class C >
PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >::PyOpalObjectSetProperty ( AttributeType  type,
std::string  opalName 
)
inline

Constructor.

  • type: type of the python object
  • opalName: name of the Opal Attribute

Definition at line 446 of file PyOpalObject.h.

◆ ~PyOpalObjectSetProperty()

destructor

Definition at line 448 of file PyOpalObject.h.

Member Function Documentation

◆ postcall()

template<class C >
template<class ArgumentPackage >
PyObject * PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >::postcall ( ArgumentPackage const &  args,
PyObject *  result 
)

postcall action

  • ArgumentPackage: this is really a PyObject* holding the argument calls
  • result: filled by the postcall operation (with PyNone). Sets the element_m to nullptr. Note that the whole element_m stuff is a bit hacky. Probably possible to extract the element from ArgumentPackage, I didn't manage to do it yet.

Definition at line 946 of file PyOpalObject.h.

◆ setObject()

template<class C >
static void PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >::setObject ( PyOpalObject< C > *  object)
inlinestatic

Set pointer to the element; should be called before each postcall.

Definition at line 461 of file PyOpalObject.h.

References PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >::object_m.

Referenced by PyOpal::PyOpalObjectNS::PyOpalObject< C >::dummySet().

Member Data Documentation

◆ object_m

template<class C >
PyOpalObject< C > * PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >::object_m = nullptr
staticprivate

◆ opalName_m

template<class C >
std::string PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >::opalName_m
private

Definition at line 465 of file PyOpalObject.h.

◆ type_m

template<class C >
AttributeType PyOpal::PyOpalObjectNS::PyOpalObjectSetProperty< C >::type_m
private

Definition at line 464 of file PyOpalObject.h.


The documentation for this struct was generated from the following file: