Lines Matching defs:sk_cfp
37 template <typename T> class sk_cfp {
41 constexpr sk_cfp() {}
42 constexpr sk_cfp(std::nullptr_t) {}
46 * created sk_cfp both have a reference to it.
48 sk_cfp(const sk_cfp<T>& that) : fObject(SkCFSafeRetain(that.get())) {}
51 * Move the underlying object from the argument to the newly created sk_cfp. Afterwards only
52 * the new sk_cfp will have a reference to the object, and the argument will point to null.
55 sk_cfp(sk_cfp<T>&& that) : fObject(that.release()) {}
58 * Adopt the bare object into the newly created sk_cfp.
61 explicit sk_cfp(T obj) {
68 ~sk_cfp() {
73 sk_cfp<T>& operator=(std::nullptr_t) { this->reset(); return *this; }
77 * sk_cfp previously had a reference to an object (i.e. not null) it will call CFRelease()
80 sk_cfp<T>& operator=(const sk_cfp<T>& that) {
88 * Move the underlying object from the argument to the sk_cfp. If the sk_cfp
92 sk_cfp<T>& operator=(sk_cfp<T>&& that) {
119 * Shares the new object by calling CFRetain() on it. If this sk_cfp previously had a
143 template <typename T> inline bool operator==(const sk_cfp<T>& a,
144 const sk_cfp<T>& b) {
147 template <typename T> inline bool operator==(const sk_cfp<T>& a,
152 const sk_cfp<T>& b) {
156 template <typename T> inline bool operator!=(const sk_cfp<T>& a,
157 const sk_cfp<T>& b) {
160 template <typename T> inline bool operator!=(const sk_cfp<T>& a,
165 const sk_cfp<T>& b) {
170 * Returns a sk_cfp wrapping the provided object AND calls retain on it (if not null).
172 * This is different than the semantics of the constructor for sk_cfp, which just wraps the
175 template <typename T> sk_cfp<T> sk_ret_cfp(T obj) {
176 return sk_cfp<T>(SkCFSafeRetain(obj));
181 template <typename T> using sk_cf_obj = sk_cfp<T>;