Base: implement a lightweight smart pointer for PyObject like Py::Object to reduce includes of Python.h in header files

This commit is contained in:
wmayer
2022-03-04 15:51:51 +01:00
parent 8020c1f975
commit 032cea587d
10 changed files with 219 additions and 5 deletions

View File

@@ -30,6 +30,7 @@
#include <App/PropertyLinks.h>
#include <App/PropertyStandard.h>
#include <Base/Matrix.h>
#include <Base/SmartPtrPy.h>
#include <bitset>
#include <unordered_map>
@@ -609,7 +610,7 @@ protected:
/// python object of this class and all descendent
protected: // attributes
Py::Object PythonObject;
Py::SmartPtr PythonObject;
/// pointer to the document this object belongs to
App::Document* _pDoc;

View File

@@ -34,6 +34,7 @@
#include <Base/Interpreter.h>
#include <Base/QuantityPy.h>
#include <Base/Console.h>
#include <CXX/Objects.hxx>
#include "ObjectIdentifier.h"
#include "Application.h"

View File

@@ -30,10 +30,11 @@
#include <string>
#include <vector>
#include <boost/any.hpp>
#include <CXX/Objects.hxx>
#include <FCConfig.h>
namespace Py {
class Object;
}
namespace App
{

View File

@@ -30,6 +30,7 @@
#include <atomic>
#include <Base/Tools.h>
#include <Base/Writer.h>
#include <CXX/Objects.hxx>
#include "Property.h"
#include "ObjectIdentifier.h"

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <Base/Reader.h>
#include <Base/Writer.h>
#include <Base/Uuid.h>