JX Application Framework
|
#include <JBroadcastTester.h>
Classes | |
struct | Validation |
Public Member Functions | |
JBroadcastTester (const JBroadcaster *obj) | |
~JBroadcastTester () override | |
void | Expect (const JUtf8Byte *type, std::function< void(const Message &)> validator=NOP) |
void | ExpectGoingAway () |
![]() | |
JBroadcaster () | |
virtual | ~JBroadcaster () |
JBroadcaster & | operator= (const JBroadcaster &source) |
bool | HasSenders () const |
JSize | GetSenderCount () const |
bool | HasRecipients () const |
JSize | GetRecipientCount () const |
virtual JString | ToString () const |
template<class T > | |
void | ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f) |
Protected Member Functions | |
void | Receive (JBroadcaster *sender, const Message &message) override |
void | ReceiveGoingAway (JBroadcaster *sender) override |
![]() | |
JBroadcaster (const JBroadcaster &source) | |
void | ListenTo (const JBroadcaster *sender) |
void | StopListening (const JBroadcaster *sender) |
void | ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember) |
void | StopListening (const JBroadcaster *sender, const std::type_info &messageType) |
template<class T > | |
void | Send (JBroadcaster *recipient, const T &message) |
template<class T > | |
void | Broadcast (const T &message) |
void | SendWithFeedback (JBroadcaster *recipient, Message *message) |
void | BroadcastWithFeedback (Message *message) |
virtual void | ReceiveWithFeedback (JBroadcaster *sender, Message *message) |
Interface for JBroadcastTester class.
Test class that verifies the expected messages.
JBroadcastTester::JBroadcastTester | ( | const JBroadcaster * | obj | ) |
|
override |
We don't bother to delete the validator objects, because this is only for functional testing. Everything is cleaned up when the program exits.
void JBroadcastTester::Expect | ( | const JUtf8Byte * | type, |
std::function< void(const Message &)> | validator = NOP |
||
) |
void JBroadcastTester::ExpectGoingAway | ( | ) |
|
overrideprotectedvirtual |
Display the message.
Reimplemented from JBroadcaster.
|
overrideprotectedvirtual |
The given sender has been deleted.
Warning: Since this function may be called from within a -chain- of destructors, it is not usually safe to do anything inside this function other than directly changing instance variables (e.g. setting pointers to nullptr).
This function is not pure virtual because not all classes will want to implement it.
Reimplemented from JBroadcaster.