Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
ToyMaker::Signal_< TArgs > Class Template Reference

A class containing most of the implementation of this engine's Signal concept. More...

#include <signals.hpp>

Inheritance diagram for ToyMaker::Signal_< TArgs >:
ToyMaker::ISignal

Public Member Functions

void emit (TArgs... args)
 Method via which the owner of the signal can send data to the signal's obervers.
 
void registerObserver (std::weak_ptr< ISignalObserver > observer) override
 Causes an eligible observer to be subscribed to this signal.
 

Private Member Functions

 Signal_ ()=default
 Constructs a new Signal_ object.
 

Private Attributes

std::set< std::weak_ptr< SignalObserver_< TArgs... > >, std::owner_less< std::weak_ptr< SignalObserver_< TArgs... > > > > mObservers {}
 Weak references to all the observers that have registered themselves with this Signal.
 

Friends

class SignalTracker
 
class Signal< TArgs... >
 

Detailed Description

template<typename ... TArgs>
class ToyMaker::Signal_< TArgs >

A class containing most of the implementation of this engine's Signal concept.

Template Parameters
TArgsThe types of data that are sent when this signal is emitted.

Constructor & Destructor Documentation

◆ Signal_()

template<typename ... TArgs>
ToyMaker::Signal_< TArgs >::Signal_ ( )
privatedefault

Constructs a new Signal_ object.

This constructor is private, and meant to be accessed only by SignalTracker.

Member Function Documentation

◆ emit()

template<typename ... TArgs>
void ToyMaker::Signal_< TArgs >::emit ( TArgs... args)

Method via which the owner of the signal can send data to the signal's obervers.

Parameters
argsA list of values relating to the signal, to be used by its handlers.

◆ registerObserver()

template<typename ... TArgs>
void ToyMaker::Signal_< TArgs >::registerObserver ( std::weak_ptr< ISignalObserver > observer)
inlineoverridevirtual

Causes an eligible observer to be subscribed to this signal.

Parameters
observerAn observer interested in this signal.

Implements ToyMaker::ISignal.


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