Urho3D
Public Member Functions | Public Attributes | Private Attributes | List of all members
Urho3D::EventReceiverGroup Class Reference

Tracking structure for event receivers. More...

#include </home/runner/work/urho3d-doxygen.github.io/urho3d-doxygen.github.io/urho3d_repo/Source/Urho3D/Core/Context.h>

Inheritance diagram for Urho3D::EventReceiverGroup:
Urho3D::RefCounted

Public Member Functions

 EventReceiverGroup ()
 Construct.
 
void BeginSendEvent ()
 Begin event send. When receivers are removed during send, group has to be cleaned up afterward.
 
void EndSendEvent ()
 End event send. Clean up if necessary. More...
 
void Add (Object *object)
 Add receiver. Same receiver must not be double-added!
 
void Remove (Object *object)
 Remove receiver. Leave holes during send, which requires later cleanup.
 
- Public Member Functions inherited from Urho3D::RefCounted
 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
 
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 
 RefCounted (const RefCounted &rhs)=delete
 Prevent copy construction.
 
RefCountedoperator= (const RefCounted &rhs)=delete
 Prevent assignment.
 
void AddRef ()
 Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
 
void ReleaseRef ()
 Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
 
int Refs () const
 Return reference count.
 
int WeakRefs () const
 Return weak reference count.
 
RefCountRefCountPtr ()
 Return pointer to the reference count structure.
 

Public Attributes

Vector< Object * > receivers_
 Receivers. May contain holes during sending.
 

Private Attributes

unsigned inSend_
 "In send" recursion counter.
 
bool dirty_
 Cleanup required flag.
 

Detailed Description

Tracking structure for event receivers.

Member Function Documentation

◆ EndSendEvent()

void Urho3D::EventReceiverGroup::EndSendEvent ( )

End event send. Clean up if necessary.

Todo:
Could be optimized by erase-swap, but this keeps the receiver order

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