OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
Classes | |
struct | AttributeDef |
class | PyOpalObject |
struct | PyOpalObjectGetProperty |
struct | PyOpalObjectSetProperty |
Enumerations | |
enum | AttributeType { DOUBLE , STRING , BOOL , INT , FLOATLIST , STRING , PREDEFINED_STRING , UPPER_CASE_STRING , STRING_LIST , DOUBLE , BOOL , INT , FLOAT_LIST } |
enum | AttributeType { DOUBLE , STRING , BOOL , INT , FLOATLIST , STRING , PREDEFINED_STRING , UPPER_CASE_STRING , STRING_LIST , DOUBLE , BOOL , INT , FLOAT_LIST } |
Functions | |
template<class C > | |
boost::python::object | getFieldValue (PyOpalObjectNS::PyOpalObject< C > &pyobject, double x, double y, double z, double t) |
Variables | |
std::map< AttributeType, std::string > | attributeName |
PyOpalObjectNS namespace contains PyOpalObject, a wrapper for Object objects, and various supporting objects.
PyOpalObject<C>: basic element wrapper for C, which should be a subclass of OpalElement. AttributeType: enumeration of Opal Attribute Types (real, string, etc) AttributeDef: struct containing all of the things PyOpalObject needs to know about each attribute that should be exposed to the python api. PyElementGetProperty: call policy to handle access of an Attribute for a python property PyElementSetProperty: call policy to handle setting of an Attribute for a python property
To wrap an OpalElement, say MyOpalObjectClass, you need to:
PyOpalObject<MyOpalObjectType>.make_class()Nb: apologies, this is heavy template stuff so almost everything has to go in the header file.
AttributeType is used to control conversion from python to OpalAttribute
Enumerator | |
---|---|
DOUBLE | |
STRING | |
BOOL | |
INT | |
FLOATLIST | |
STRING | |
PREDEFINED_STRING | |
UPPER_CASE_STRING | |
STRING_LIST | |
DOUBLE | |
BOOL | |
INT | |
FLOAT_LIST |
Definition at line 61 of file PyOpalObject.h.
AttributeType is used to control conversion from python to OpalAttribute
Enumerator | |
---|---|
DOUBLE | |
STRING | |
BOOL | |
INT | |
FLOATLIST | |
STRING | |
PREDEFINED_STRING | |
UPPER_CASE_STRING | |
STRING_LIST | |
DOUBLE | |
BOOL | |
INT | |
FLOAT_LIST |
Definition at line 61 of file PyOpalObject.h.
boost::python::object PyOpal::PyOpalObjectNS::getFieldValue | ( | PyOpalObjectNS::PyOpalObject< C > & | pyobject, |
double | x, | ||
double | y, | ||
double | z, | ||
double | t | ||
) |
Definition at line 206 of file PyOpalObject.h.
References Component::apply(), PyOpal::PyOpalObjectNS::PyOpalObject< C >::getOpalShared(), and Attrib::Distribution::R.
Referenced by PyOpal::PyElementNS::PyElement< C >::addAttributes().
std::map< AttributeType, std::string > PyOpal::PyOpalObjectNS::attributeName |
Maps the AttributeType to a string representation for docstrings/etc
Definition at line 7 of file PyOpalObject.cpp.
Referenced by PyOpal::PyOpalObjectNS::PyOpalObject< C >::getAttribute(), PyOpal::PyOpalObjectNS::PyOpalObject< C >::getDocString(), and PyOpal::PyOpalObjectNS::PyOpalObject< C >::setAttribute().