FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
fge::Subscriber Class Reference

This class is a useful utility to "link" multiple objects around. More...

#include <C_subscription.hpp>

Inheritance diagram for fge::Subscriber:
fge::GuiElementHandler fge::ObjButton fge::ObjRenderMap fge::ObjSelectBox fge::ObjSlider fge::ObjTextInputBox fge::ObjTextList fge::ObjWindow

Public Member Functions

 Subscriber (fge::Subscriber const &n)
 
 Subscriber (fge::Subscriber &&n) noexcept=delete
 
virtual ~Subscriber ()
 When the object is destroyed, it will detach from all subscriptions.
 
fge::Subscriberoperator= (fge::Subscriber const &n)
 
fge::Subscriberoperator= (fge::Subscriber &&n) noexcept=delete
 
void detachAll ()
 Detach from all subscriptions.
 
void detach (fge::Subscription *subscription)
 Detach from a specific subscription.
 

Protected Member Functions

virtual void onDetach (fge::Subscription *subscription)
 Callback called when a subscription is detached.
 

Friends

class fge::Subscription
 

Detailed Description

This class is a useful utility to "link" multiple objects around.

By inheriting from this class, you will be able to subscribe to a Subscription like a CallbackHandler and you don't have to worry about unsubscribing it when the object is destroyed.

See also
Subscription

Constructor & Destructor Documentation

◆ Subscriber() [1/2]

fge::Subscriber::Subscriber ( fge::Subscriber const & n)
inline
Warning
Empty copy constructor as it's not permitted (does nothing)

◆ Subscriber() [2/2]

fge::Subscriber::Subscriber ( fge::Subscriber && n)
deletenoexcept
Warning
Move constructor prohibited

◆ ~Subscriber()

virtual fge::Subscriber::~Subscriber ( )
inlinevirtual

When the object is destroyed, it will detach from all subscriptions.

Member Function Documentation

◆ detach()

void fge::Subscriber::detach ( fge::Subscription * subscription)

Detach from a specific subscription.

Parameters
subscription

◆ detachAll()

void fge::Subscriber::detachAll ( )

Detach from all subscriptions.

◆ onDetach()

virtual void fge::Subscriber::onDetach ( fge::Subscription * subscription)
inlineprotectedvirtual

Callback called when a subscription is detached.

Parameters
subscriptionThe subscription that was detached

◆ operator=() [1/2]

fge::Subscriber & fge::Subscriber::operator= ( fge::Subscriber && n)
deletenoexcept
Warning
Move operator prohibited

◆ operator=() [2/2]

fge::Subscriber & fge::Subscriber::operator= ( fge::Subscriber const & n)
inline
Warning
Empty copy operator as it's not permitted (does nothing)

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