SmartSoft Component-Developer API
|
This template class implements the Subject (also called Model) part of the Observer design pattern for implementing delegation of handling incoming data. More...
#include <smartIInputHandler_T.h>
Public Member Functions | |
virtual | ~InputSubject ()=default |
Default destructor. More... | |
Protected Member Functions | |
virtual void | attach (IInputHandler< InputType > *handler, const unsigned int &prescaleFactor=1) |
Attach an IInputHandler<InputType> instance. More... | |
virtual void | detach (IInputHandler< InputType > *handler) |
Detach an IInputHandler<InputType> instance. More... | |
virtual bool | notify_input (const InputType &input) |
Notifies all attached IInputHandler instances about incoming data. More... | |
Friends | |
class | IInputHandler< InputType > |
allows calling protected attach() and detach() methods More... | |
This template class implements the Subject (also called Model) part of the Observer design pattern for implementing delegation of handling incoming data.
All Communication-Patterns that internally receive input data (e.g. IPushClient, or IQueryServer) can implement this interface to allow the definition of upcall-handlers for handling input-data.
|
virtualdefault |
Default destructor.
|
inlineprotectedvirtual |
Attach an IInputHandler<InputType> instance.
This method should be called from within the constructor of an IInputHandler instance. This is possible because the IInputHandler is defined as a friend class of IInputSubject.
handler | the InputHandler pointer |
prescaleFactor | divides the input-update frequency by this factor |
|
inlineprotectedvirtual |
Detach an IInputHandler<InputType> instance.
This method should be called from within the destructor of an IInputHandler instance. This is possible because the IInputHandler is defined as a friend class of IInputSubject.
handler | the InputHandler pointer |
|
inlineprotectedvirtual |
Notifies all attached IInputHandler instances about incoming data.
An instance of IInputSubject should call this method each time new data arrives. This method then delegates the input-data-handling to all attached IInputHandler instances.
input | the input-data reference |
|
friend |