The python export class for Unit. More...

#include <UnitPy.h>

Public Types

typedef Unit * PointerType
 
- Public Types inherited from Base::PyObjectBase
typedef void * PointerType
 
enum  Status { Valid = 0, Immutable = 1, Notify = 2, NoTrack = 3 }
 

Public Member Functions

virtual PyTypeObject * GetType (void)
 
virtual int PyInit (PyObject *args, PyObject *k)
 PyInit method Override this method to initialize a newly created instance of the class (Constructor) More...
 
std::string representation (void) const
 
 UnitPy (Unit *pcObject, PyTypeObject *T=&Type)
 
- Public Member Functions inherited from Base::PyObjectBase
PyObjectBase * DecRef (void)
 decref method wrapper (see python extending manual)
More...
 
PyObjectBase * IncRef (void)
 incref method wrapper (see python extending manual) More...
 
bool isConst ()
 
bool isNotTracking () const
 
bool isValid ()
 
 PyObjectBase (void *, PyTypeObject *T)
 Constructor Sets the Type of the object (for inheritance) and decrease the the reference count of the PyObject. More...
 
void setConst ()
 
void setInvalid ()
 
void setNotTracking (bool on=true)
 
void setShouldNotify (bool on)
 
bool shouldNotify () const
 
void startNotify ()
 

Static Public Member Functions

static PyObject * PyMake (struct _typeobject *, PyObject *, PyObject *)
 
static PyObject * richCompare (PyObject *v, PyObject *w, int op)
 
callbacks and implementers for the python object number protocol
static PyObject * number_add_handler (PyObject *self, PyObject *other)
 callback for the number_add_handler More...
 
static PyObject * number_subtract_handler (PyObject *self, PyObject *other)
 callback for the number_subtract_handler More...
 
static PyObject * number_multiply_handler (PyObject *self, PyObject *other)
 callback for the number_multiply_handler More...
 
static PyObject * number_divide_handler (PyObject *self, PyObject *other)
 callback for the number_divide_handler More...
 
static PyObject * number_remainder_handler (PyObject *self, PyObject *other)
 callback for the number_remainder_handler More...
 
static PyObject * number_divmod_handler (PyObject *self, PyObject *other)
 callback for the number_divmod_handler More...
 
static PyObject * number_power_handler (PyObject *self, PyObject *other, PyObject *modulo)
 callback for the number_power_handler More...
 
static PyObject * number_negative_handler (PyObject *self)
 callback for the number_negative_handler More...
 
static PyObject * number_positive_handler (PyObject *self)
 callback for the number_positive_handler More...
 
static PyObject * number_absolute_handler (PyObject *self)
 callback for the number_absolute_handler More...
 
static int number_nonzero_handler (PyObject *self)
 callback for the number_nonzero_handler More...
 
static PyObject * number_invert_handler (PyObject *self)
 callback for the number_invert_handler More...
 
static PyObject * number_lshift_handler (PyObject *self, PyObject *other)
 callback for the number_lshift_handler More...
 
static PyObject * number_rshift_handler (PyObject *self, PyObject *other)
 callback for the number_rshift_handler More...
 
static PyObject * number_and_handler (PyObject *self, PyObject *other)
 callback for the number_and_handler More...
 
static PyObject * number_xor_handler (PyObject *self, PyObject *other)
 callback for the number_xor_handler More...
 
static PyObject * number_or_handler (PyObject *self, PyObject *other)
 callback for the number_or_handler More...
 
static int number_coerce_handler (PyObject **self, PyObject **other)
 callback for the number_coerce_handler More...
 
static PyObject * number_int_handler (PyObject *self)
 callback for the number_int_handler More...
 
static PyObject * number_long_handler (PyObject *self)
 callback for the number_long_handler More...
 
static PyObject * number_float_handler (PyObject *self)
 callback for the number_float_handler More...
 
static PyObject * number_oct_handler (PyObject *self)
 callback for the number_oct_handler More...
 
static PyObject * number_hex_handler (PyObject *self)
 callback for the number_hex_handler More...
 
- Static Public Member Functions inherited from Base::PyObjectBase
static void PyDestructor (PyObject *P)
 Wrapper for the Python destructor. More...
 

Static Public Attributes

static PyGetSetDef GetterSetter []
 Attribute structure of UnitPy. More...
 
static PyMethodDef Methods []
 Methods structure of UnitPy. More...
 
static PyNumberMethods Number []
 
static PyTypeObject Type
 Type structure of UnitPy. More...
 
- Static Public Attributes inherited from Base::PyObjectBase
static PyMethodDef Methods []
 
static PyTypeObject Type
 Py_Header struct from python.h. More...
 

Protected Member Functions

 ~UnitPy ()
 
- Protected Member Functions inherited from Base::PyObjectBase
virtual ~PyObjectBase ()
 destructor More...
 

callbacks and implementers for the python object attributes

static PyObject * staticCallback_getType (PyObject *self, void *closure)
 getter callback for the Type attribute More...
 
static int staticCallback_setType (PyObject *self, PyObject *value, void *closure)
 setter callback for the Type attribute More...
 
static PyObject * staticCallback_getSignature (PyObject *self, void *closure)
 getter callback for the Signature attribute More...
 
static int staticCallback_setSignature (PyObject *self, PyObject *value, void *closure)
 setter callback for the Signature attribute More...
 
Py::String getType (void) const
 getter for the Type attribute More...
 
Py::Tuple getSignature (void) const
 getter for the Signature attribute More...
 
PyObject * getCustomAttributes (const char *attr) const
 getter method for special attributes (e.g. dynamic ones) More...
 
int setCustomAttributes (const char *attr, PyObject *obj)
 setter for special attributes (e.g. More...
 
Unit * getUnitPtr (void) const
 getter for the object handled by this class More...
 

Additional Inherited Members

- Protected Attributes inherited from Base::PyObjectBase
std::bitset< 32 > StatusBits
 

Detailed Description

The python export class for Unit.

Member Typedef Documentation

◆ PointerType

Constructor & Destructor Documentation

◆ ~UnitPy()

UnitPy::~UnitPy ( )
protected

◆ UnitPy()

UnitPy::UnitPy ( Unit *  pcObject,
PyTypeObject *  T = &Type 
)

Member Function Documentation

◆ getCustomAttributes()

PyObject * UnitPy::getCustomAttributes ( const char *  attr) const

getter method for special attributes (e.g. dynamic ones)

◆ getSignature()

◆ GetType()

virtual PyTypeObject* Base::UnitPy::GetType ( void  )
virtual

Reimplemented from Base::PyObjectBase.

◆ getType()

Py::String UnitPy::getType ( void  ) const

◆ getUnitPtr()

Unit * UnitPy::getUnitPtr ( void  ) const

◆ number_absolute_handler()

PyObject * UnitPy::number_absolute_handler ( PyObject *  self)
static

callback for the number_absolute_handler

◆ number_add_handler()

PyObject * UnitPy::number_add_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_add_handler

References getUnitPtr(), Type, and UnitPy().

◆ number_and_handler()

PyObject * UnitPy::number_and_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_and_handler

◆ number_coerce_handler()

int UnitPy::number_coerce_handler ( PyObject **  self,
PyObject **  other 
)
static

callback for the number_coerce_handler

◆ number_divide_handler()

PyObject * UnitPy::number_divide_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_divide_handler

◆ number_divmod_handler()

PyObject * UnitPy::number_divmod_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_divmod_handler

◆ number_float_handler()

PyObject * UnitPy::number_float_handler ( PyObject *  self)
static

callback for the number_float_handler

◆ number_hex_handler()

PyObject * UnitPy::number_hex_handler ( PyObject *  self)
static

callback for the number_hex_handler

◆ number_int_handler()

PyObject * UnitPy::number_int_handler ( PyObject *  self)
static

callback for the number_int_handler

◆ number_invert_handler()

PyObject * UnitPy::number_invert_handler ( PyObject *  self)
static

callback for the number_invert_handler

◆ number_long_handler()

PyObject * UnitPy::number_long_handler ( PyObject *  self)
static

callback for the number_long_handler

◆ number_lshift_handler()

PyObject * UnitPy::number_lshift_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_lshift_handler

◆ number_multiply_handler()

PyObject * UnitPy::number_multiply_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_multiply_handler

References getUnitPtr(), Type, and UnitPy().

◆ number_negative_handler()

PyObject * UnitPy::number_negative_handler ( PyObject *  self)
static

callback for the number_negative_handler

◆ number_nonzero_handler()

int UnitPy::number_nonzero_handler ( PyObject *  self)
static

callback for the number_nonzero_handler

◆ number_oct_handler()

PyObject * UnitPy::number_oct_handler ( PyObject *  self)
static

callback for the number_oct_handler

◆ number_or_handler()

PyObject * UnitPy::number_or_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_or_handler

◆ number_positive_handler()

PyObject * UnitPy::number_positive_handler ( PyObject *  self)
static

callback for the number_positive_handler

◆ number_power_handler()

PyObject * UnitPy::number_power_handler ( PyObject *  self,
PyObject *  other,
PyObject *  modulo 
)
static

callback for the number_power_handler

◆ number_remainder_handler()

PyObject * UnitPy::number_remainder_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_remainder_handler

◆ number_rshift_handler()

PyObject * UnitPy::number_rshift_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_rshift_handler

◆ number_subtract_handler()

PyObject * UnitPy::number_subtract_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_subtract_handler

References getUnitPtr(), Type, and UnitPy().

◆ number_xor_handler()

PyObject * UnitPy::number_xor_handler ( PyObject *  self,
PyObject *  other 
)
static

callback for the number_xor_handler

◆ PyInit()

int UnitPy::PyInit ( PyObject *  ,
PyObject *   
)
virtual

PyInit method Override this method to initialize a newly created instance of the class (Constructor)

Reimplemented from Base::PyObjectBase.

References Base::QuantityPy::getUnit(), Base::Quantity::getUnit(), getUnitPtr(), Base::Quantity::parse(), Base::QuantityPy::Type, and Type.

◆ PyMake()

PyObject * UnitPy::PyMake ( struct _typeobject *  ,
PyObject *  ,
PyObject *   
)
static

References UnitPy().

◆ representation()

◆ richCompare()

PyObject * UnitPy::richCompare ( PyObject *  v,
PyObject *  w,
int  op 
)
static

References getUnitPtr(), and Type.

◆ setCustomAttributes()

int UnitPy::setCustomAttributes ( const char *  attr,
PyObject *  obj 
)

setter for special attributes (e.g.

dynamic ones) Output: Success=1, Failure=-1, Ignore=0

◆ staticCallback_getSignature()

PyObject * UnitPy::staticCallback_getSignature ( PyObject *  self,
void *  closure 
)
static

getter callback for the Signature attribute

References Base::BaseExceptionFreeCADError, getSignature(), and Base::PyObjectBase::isValid().

◆ staticCallback_getType()

PyObject * UnitPy::staticCallback_getType ( PyObject *  self,
void *  closure 
)
static

getter callback for the Type attribute

References Base::BaseExceptionFreeCADError, getType(), and Base::PyObjectBase::isValid().

◆ staticCallback_setSignature()

int UnitPy::staticCallback_setSignature ( PyObject *  self,
PyObject *  value,
void *  closure 
)
static

setter callback for the Signature attribute

References Base::PyObjectBase::isValid().

◆ staticCallback_setType()

int UnitPy::staticCallback_setType ( PyObject *  self,
PyObject *  value,
void *  closure 
)
static

setter callback for the Type attribute

References Base::PyObjectBase::isValid().

Member Data Documentation

◆ GetterSetter

PyGetSetDef UnitPy::GetterSetter
static
Initial value:
= {
{"Type",
"holds the unit type as a string, e.g. 'Area'.",
NULL
},
{"Signature",
"Returns the signature.",
NULL
},
{NULL, NULL, NULL, NULL, NULL}
}

Attribute structure of UnitPy.

◆ Methods

PyMethodDef UnitPy::Methods
static
Initial value:
= {
{NULL, NULL, 0, NULL}
}

Methods structure of UnitPy.

◆ Number

PyNumberMethods UnitPy::Number
static

◆ Type


The documentation for this class was generated from the following files:
  • build/webdoc/src/Base/UnitPy.h
  • src/Base/UnitPyImp.cpp
  • build/webdoc/src/Base/UnitPy.cpp
static int staticCallback_setSignature(PyObject *self, PyObject *value, void *closure)
setter callback for the Signature attribute
Definition: UnitPy.cpp:226
static PyObject * staticCallback_getType(PyObject *self, void *closure)
getter callback for the Type attribute
Definition: UnitPy.cpp:176
static PyObject * staticCallback_getSignature(PyObject *self, void *closure)
getter callback for the Signature attribute
Definition: UnitPy.cpp:208
static int staticCallback_setType(PyObject *self, PyObject *value, void *closure)
setter callback for the Type attribute
Definition: UnitPy.cpp:194