 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_OBJECT_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_OBJECT_H_
11 #include "flutter/fml/logging.h"
32 if (ref_count_-- == 1u) {
52 std::atomic_uint64_t ref_count_ = {1u};
55 template <
typename Clasz,
typename CSibling>
66 template <
typename Object>
90 if (object_ == other.object_) {
97 FML_DCHECK(object_ ==
nullptr);
98 object_ = other.object_;
103 std::swap(object_, other.object_);
123 explicit operator bool()
const {
return !!object_; }
127 auto to_leak = object_;
133 Object* object_ =
nullptr;
144 template <
typename Object>
149 template <
typename Object>
154 template <
typename Object>
159 template <
typename Object,
typename... CtorArgs>
167 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_OBJECT_H_
uint64_t GetRefCountForTests() const
static void SafeRelease(void *ptr)
ScopedObject(const ScopedObject &other)
virtual ~ObjectBase()=default
Object::InteropCSibling * GetC() const
IMPELLER_INTERNAL_HANDLE_NAME(ImpellerSurface) InteropCSibling
Object * operator->() const
ScopedObject & operator=(ScopedObject &&other)
ScopedObject(Object *ptr, AdoptTag)
ScopedObject< Object > Ref(Object *object)
ScopedObject & operator=(const ScopedObject &other)
ScopedObject(std::nullptr_t)
Object & operator*() const
ScopedObject(Object *ptr)
Object::InteropCSibling * Leak()
ScopedObject< Object > Adopt(Object *object)
ObjectBase & operator=(const ObjectBase &)=delete
static void SafeRetain(void *ptr)
ScopedObject< Object > Create(CtorArgs &&... args)
ScopedObject(ScopedObject &&other)