Skip to content

Demo code to test memory management for pythonocc

Notifications You must be signed in to change notification settings

rainman110/swighandles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This is a simple demo code to test, how the memory management can be performed using OpenCASCADE like Handle_ classes from python/swig.

The aim is, to have a non-leaking and non-crashing python wrapping of the C++ classes and making the existence of the Handle_ classes invisibile for python users. Assume we have the wollowing C++ prototypes:

void DoSomething(const A& a);
void DoSomethingElse(Handle_A ah);

Then, the following python code is possible:

a = A()
DoSomething(a);
DoSomethingElse(a);

At no point, the user is confronted with the Handle_ classes.

Important note To be backwards compatible with existing pythonocc code, you can still call the .GetObject() and .GetHandle() methods. They simply do nothing and just return self.

Dependencies:

  • Python + Libraries
  • Swig
  • CMake

About

Demo code to test memory management for pythonocc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published