Flutter Engine
fml::internal::WeakPtrFlag Class Reference

#include <weak_ptr_internal.h>

Inheritance diagram for fml::internal::WeakPtrFlag:
fml::RefCountedThreadSafe< WeakPtrFlag > fml::internal::RefCountedThreadSafeBase

Public Member Functions

 WeakPtrFlag ()
 
 ~WeakPtrFlag ()
 
bool is_valid () const
 
void Invalidate ()
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< WeakPtrFlag >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 

Additional Inherited Members

- Protected Member Functions inherited from fml::RefCountedThreadSafe< WeakPtrFlag >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 

Detailed Description

Definition at line 22 of file weak_ptr_internal.h.

Constructor & Destructor Documentation

◆ WeakPtrFlag()

fml::internal::WeakPtrFlag::WeakPtrFlag ( )

Definition at line 12 of file weak_ptr_internal.cc.

12 : is_valid_(true) {}

◆ ~WeakPtrFlag()

fml::internal::WeakPtrFlag::~WeakPtrFlag ( )

Definition at line 14 of file weak_ptr_internal.cc.

References FML_DCHECK.

14  {
15  // Should be invalidated before destruction.
16  FML_DCHECK(!is_valid_);
17 }
#define FML_DCHECK(condition)
Definition: logging.h:86

Member Function Documentation

◆ Invalidate()

void fml::internal::WeakPtrFlag::Invalidate ( )

Definition at line 19 of file weak_ptr_internal.cc.

References FML_DCHECK.

Referenced by is_valid().

19  {
20  // Invalidation should happen exactly once.
21  FML_DCHECK(is_valid_);
22  is_valid_ = false;
23 }
#define FML_DCHECK(condition)
Definition: logging.h:86

◆ is_valid()

bool fml::internal::WeakPtrFlag::is_valid ( ) const
inline

Definition at line 28 of file weak_ptr_internal.h.

References Invalidate().

28 { return is_valid_; }

The documentation for this class was generated from the following files: