diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 08:24:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 08:24:47 +0200 |
commit | 67d635fe2cc2c89c30486a2e26dea4106a9d9c16 (patch) | |
tree | b26f1bb7a9639f2b2a875c0cb2b937858b700add /sources/shiboken2/libshiboken/basewrapper_p.h | |
parent | ffd068caf7063799e0196602e31ca7b1781c3f97 (diff) | |
parent | 75f824b13a2ef12a9a5a33db19216b4e43a72922 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I389468b76913ac3c8113ab89833c756a7a72e54f
Diffstat (limited to 'sources/shiboken2/libshiboken/basewrapper_p.h')
-rw-r--r-- | sources/shiboken2/libshiboken/basewrapper_p.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper_p.h b/sources/shiboken2/libshiboken/basewrapper_p.h index f8a381078..56a647b21 100644 --- a/sources/shiboken2/libshiboken/basewrapper_p.h +++ b/sources/shiboken2/libshiboken/basewrapper_p.h @@ -58,18 +58,18 @@ namespace Shiboken * This mapping associates a method and argument of an wrapper object with the wrapper of * said argument when it needs the binding to help manage its reference count. */ -typedef std::unordered_multimap<std::string, PyObject *> RefCountMap; +using RefCountMap = std::unordered_multimap<std::string, PyObject *> ; /// Linked list of SbkBaseWrapper pointers -typedef std::set<SbkObject*> ChildrenList; +using ChildrenList = std::set<SbkObject *>; /// Structure used to store information about object parent and children. struct ParentInfo { /// Default ctor. - ParentInfo() : parent(0), hasWrapperRef(false) {} + ParentInfo() : parent(nullptr), hasWrapperRef(false) {} /// Pointer to parent object. - SbkObject* parent; + SbkObject *parent; /// List of object children. ChildrenList children; /// has internal ref @@ -88,7 +88,7 @@ extern "C" struct SbkObjectPrivate { /// Pointer to the C++ class. - void** cptr; + void ** cptr; /// True when Python is responsible for freeing the used memory. unsigned int hasOwnership : 1; /// This is true when the C++ class of the wrapped object has a virtual destructor AND was created by Python. @@ -98,16 +98,16 @@ struct SbkObjectPrivate /// Marked as true when the object constructor was called unsigned int cppObjectCreated : 1; /// Information about the object parents and children, may be null. - Shiboken::ParentInfo* parentInfo; + Shiboken::ParentInfo *parentInfo; /// Manage reference count of objects that are referred to but not owned from. - Shiboken::RefCountMap* referredObjects; + Shiboken::RefCountMap *referredObjects; ~SbkObjectPrivate() { delete parentInfo; - parentInfo = 0; + parentInfo = nullptr; delete referredObjects; - referredObjects = 0; + referredObjects = nullptr; } }; @@ -121,8 +121,8 @@ struct SbkObjectPrivate struct SbkObjectTypePrivate { - SbkConverter* converter; - int* mi_offsets; + SbkConverter *converter; + int *mi_offsets; MultipleInheritanceInitFunction mi_init; /// Special cast function, null if this class doesn't have multiple inheritance. @@ -134,16 +134,16 @@ struct SbkObjectTypePrivate int is_multicpp : 1; /// True if this type was defined by the user. int is_user_type : 1; - /// Tells is the type is a value type or an object-type, see BEHAVIOUR_* constants. + /// Tells is the type is a value type or an object-type, see BEHAVIOUR_ *constants. // TODO-CONVERTERS: to be deprecated/removed int type_behaviour : 2; int delete_in_main_thread : 1; /// C++ name - char* original_name; + char *original_name; /// Type user data - void* user_data; + void *user_data; DeleteUserDataFunc d_func; - void (*subtype_init)(SbkObjectType*, PyObject*, PyObject*); + void (*subtype_init)(SbkObjectType *, PyObject *, PyObject *); }; @@ -165,7 +165,7 @@ struct DestructorEntry /** * Utility function used to transform a PyObject that implements sequence protocol into a std::list. **/ -std::vector<SbkObject *> splitPyObject(PyObject* pyObj); +std::vector<SbkObject *> splitPyObject(PyObject *pyObj); /** * Visitor class used by walkOnClassHierarchy function. @@ -198,7 +198,7 @@ private: class BaseAccumulatorVisitor : public HierarchyVisitor { public: - typedef std::vector<SbkObjectType *> Result; + using Result = std::vector<SbkObjectType *>; bool visit(SbkObjectType *node) override; @@ -211,7 +211,7 @@ private: class GetIndexVisitor : public HierarchyVisitor { public: - explicit GetIndexVisitor(PyTypeObject* desiredType) : m_desiredType(desiredType) {} + explicit GetIndexVisitor(PyTypeObject *desiredType) : m_desiredType(desiredType) {} bool visit(SbkObjectType *node) override; @@ -248,21 +248,21 @@ private: */ bool walkThroughClassHierarchy(PyTypeObject *currentType, HierarchyVisitor *visitor); -inline int getTypeIndexOnHierarchy(PyTypeObject* baseType, PyTypeObject* desiredType) +inline int getTypeIndexOnHierarchy(PyTypeObject *baseType, PyTypeObject *desiredType) { GetIndexVisitor visitor(desiredType); walkThroughClassHierarchy(baseType, &visitor); return visitor.index(); } -inline int getNumberOfCppBaseClasses(PyTypeObject* baseType) +inline int getNumberOfCppBaseClasses(PyTypeObject *baseType) { BaseCountVisitor visitor; walkThroughClassHierarchy(baseType, &visitor); return visitor.count(); } -inline std::vector<SbkObjectType *> getCppBaseClasses(PyTypeObject* baseType) +inline std::vector<SbkObjectType *> getCppBaseClasses(PyTypeObject *baseType) { BaseAccumulatorVisitor visitor; walkThroughClassHierarchy(baseType, &visitor); @@ -275,12 +275,12 @@ namespace Object * Decrements the reference counters of every object referred by self. * \param self the wrapper instance that keeps references to other objects. */ -void clearReferences(SbkObject* self); +void clearReferences(SbkObject *self); /** * Destroy internal data **/ -void deallocData(SbkObject* self, bool doCleanup); +void deallocData(SbkObject *self, bool doCleanup); } // namespace Object |