The following constructs can be handled by sip: typedef, struct, class, public, protected, private, signals, slots, virtual, const, static, void, bool, char, short, unsigned, int, long, float, double and enum. There are some restrictions:
Member functions
Static functions must be public and cannot be virtual.
The syntax of class method declarations is as follows:
name ([arg]..) [const] [=0] [/optflag[,optflag]../] ; [member_code]
Option flags can be given in a comma separated list of optflags enclosed in slashes. optflags can be boolean, or take a value. The following flags are recognized:
Table C-4. Flags in member function declaration
PyName=py_name Use py_name instead of the C++ function name ReleaseLock Release the python interpreter lock PreHook=hook_function Define hook_function to be called prior to the memberfunc PostHook=hook_function Define hook_function to be called after the memberfunc Transfer Ownership is transferred TransferThis Ownership of this is transferred TransferBack Ownership is transferred back
If the function is protected, call the public wrapper. Otherwise, explicitly call the real function and not any version in the wrapper class (in case it is virtual). This will prevent virtual loops. You don't need to worry about indirected objects for protected functions.