|
Krita Source Code Documentation
|
#include <QSharedPointer>#include <QForeach>Go to the source code of this file.
Functions | |
| template<typename R , typename T , template< typename U > class Container> | |
| Container< R > | implicitCastList (const Container< T > &list) |
| template<template< class > class Container, class T > | |
| Container< QWeakPointer< T > > | listStrongToWeak (const Container< QSharedPointer< T > > &container) |
| template<class A , template< class C > class List> | |
| List< QSharedPointer< A > > | listToQShared (const List< A * > list) |
| template<template< class > class Container, class T > | |
| Container< QSharedPointer< T > > | listWeakToStrong (const Container< QWeakPointer< T > > &container, bool allOrNothing=true) |
| template<typename T > | |
| T * | removeSharedPointer (KisPinnedSharedPtr< T > value) |
| template<typename T > | |
| T * | removeSharedPointer (KisSharedPtr< T > value) |
| template<typename T > | |
| T * | removeSharedPointer (QSharedPointer< T > value) |
| template<typename T > | |
| T * | removeSharedPointer (T *value) |
| template<class T > | |
| QSharedPointer< T > | toQShared (T *ptr) |
|
inline |
Converts a list of objects with type T into a list of objects of type R. The conversion is done implicitly, therefore the c-tor of type R should support it. The main usage case is conversion of pointers in "descendant- to-parent" way.
Definition at line 83 of file kis_pointer_utils.h.
| Container< QWeakPointer< T > > listStrongToWeak | ( | const Container< QSharedPointer< T > > & | container | ) |
Convert a list of strong pointers into a list of weak pointers
Definition at line 40 of file kis_pointer_utils.h.
References v.
| List< QSharedPointer< A > > listToQShared | ( | const List< A * > | list | ) |
Convert a list of raw pointers into a list of shared pointers
Definition at line 27 of file kis_pointer_utils.h.
References A, toQShared(), and value().
| Container< QSharedPointer< T > > listWeakToStrong | ( | const Container< QWeakPointer< T > > & | container, |
| bool | allOrNothing = true ) |
Convert a list of weak pointers into a list of strong pointers
WARNING: By default, uses "all or nothing" rule. If at least one of the weak pointers is invalid, returns an empty list! Even though some other pointer can still be converted correctly.
Definition at line 58 of file kis_pointer_utils.h.
References v.
| T * removeSharedPointer | ( | KisPinnedSharedPtr< T > | value | ) |
Definition at line 115 of file kis_pointer_utils.h.
References value().
| T * removeSharedPointer | ( | KisSharedPtr< T > | value | ) |
Definition at line 121 of file kis_pointer_utils.h.
References value().
| T * removeSharedPointer | ( | QSharedPointer< T > | value | ) |
Definition at line 127 of file kis_pointer_utils.h.
References value().
| T * removeSharedPointer | ( | T * | value | ) |
|
inline |
Convert a raw pointer into a shared pointer
Definition at line 19 of file kis_pointer_utils.h.