File: PyGrabberCallback.pxi

package info (click to toggle)
python-pcl 0.3.0~rc1%2Bdfsg-14
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 31,828 kB
  • sloc: python: 3,094; cpp: 283; makefile: 181; sh: 24; ansic: 12
file content (21 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-
cimport pcl_grabber as pcl_grb
from ../../grabber_callback cimport PyLibCallBack
from ../../grabber_callback cimport callback

cdef class PyGrabberCallback:
    cdef PyLibCallBack* thisptr

    def __cinit__(self, method):
        # 'callback' :: The pattern/converter method to fire a Python 
        #               object method from C typed infos
        # 'method'   :: The effective method passed by the Python user 
        self.thisptr = new PyLibCallBack(callback, <void*>method)

    def __dealloc__(self):
       if self.thisptr:
           del self.thisptr

    cpdef double execute(self, parameter):
        # 'parameter' :: The parameter to be passed to the 'method'
        return self.thisptr.cy_execute(<void*>parameter)