Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
SkIDChangeListener Class Referenceabstract

#include <SkIDChangeListener.h>

Inheritance diagram for SkIDChangeListener:
SkRefCnt SkRefCntBase TestListener

Classes

class  List
 

Public Member Functions

 SkIDChangeListener ()
 
 ~SkIDChangeListener () override
 
virtual void changed ()=0
 
void markShouldDeregister ()
 
bool shouldDeregister ()
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Detailed Description

Used to be notified when a gen/unique ID is invalidated, typically to preemptively purge associated items from a cache that are no longer reachable. The listener can be marked for deregistration if the cached item is remove before the listener is triggered. This prevents unbounded listener growth when cache items are routinely removed before the gen ID/unique ID is invalidated.

Definition at line 25 of file SkIDChangeListener.h.

Constructor & Destructor Documentation

◆ SkIDChangeListener()

SkIDChangeListener::SkIDChangeListener ( )

Used to be notified when a gen/unique ID is invalidated, typically to preemptively purge associated items from a cache that are no longer reachable. The listener can be marked for deregistration if the cached item is remove before the listener is triggered. This prevents unbounded listener growth when cache items are routinely removed before the gen ID/unique ID is invalidated.

Definition at line 21 of file SkIDChangeListener.cpp.

21: fShouldDeregister(false) {}

◆ ~SkIDChangeListener()

SkIDChangeListener::~SkIDChangeListener ( )
overridedefault

Member Function Documentation

◆ changed()

virtual void SkIDChangeListener::changed ( )
pure virtual

Implemented in TestListener.

◆ markShouldDeregister()

void SkIDChangeListener::markShouldDeregister ( )
inline

Mark the listener is no longer needed. It should be removed and changed() should not be called.

Definition at line 37 of file SkIDChangeListener.h.

37{ fShouldDeregister.store(true, std::memory_order_relaxed); }

◆ shouldDeregister()

bool SkIDChangeListener::shouldDeregister ( )
inline

Indicates whether markShouldDeregister was called.

Definition at line 40 of file SkIDChangeListener.h.

40{ return fShouldDeregister.load(std::memory_order_acquire); }

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