SmartSoft Component-Developer API
|
This template class implements the Observer part of the Observer design pattern for implementing a generic data-input-handler (i.e. More...
#include <smartIInputHandler_T.h>
Public Member Functions | |
IInputHandler (InputSubject< InputType > *subject, const unsigned int &prescaleFactor=1) | |
The default constructor. More... | |
virtual | ~IInputHandler () |
The default destructor. More... | |
virtual void | handle_input (const InputType &input)=0 |
This is the main input-handler method that will be automatically called from the given subject each time the subject receives input-data. More... | |
Protected Member Functions | |
void | attach_self (const unsigned int &prescale=1) |
calls subject->attach(this); More... | |
void | detach_self () |
calls subject->detach(this); More... | |
Protected Attributes | |
InputSubject< InputType > * | subject |
this is the subject-pointer (can be used in derived classes) More... | |
Friends | |
template<class InnerType > | |
class | IActiveQueueInputHandlerDecorator |
allows acessing protected members More... | |
This template class implements the Observer part of the Observer design pattern for implementing a generic data-input-handler (i.e.
input-data-upcall handler).
This class implements the Observer part of the Observer design pattern. All the communication-patterns that receive input-data can implement the counterpart IInputSubject which can be used by this handler for receiving the input-data. Therefore the abstract method handle_input() needs to be implemented in derived classes.
|
inline |
The default constructor.
This constructor will call subject->attach(this) to start observing the given subject.
subject | the subject (also called model) that this handler is going to observe |
prescaleFactor | optionally divides the input-update frequency by this factor |
|
inlinevirtual |
The default destructor.
This destructor will call subject->detach(this) to stop observing the given subject.
|
inlineprotected |
calls subject->attach(this);
This method encapsulates the attachment of itself to the IInputSubject. This is useful as this method can be called from within the IActiveQueueInputHandlerDecorator.
prescale | optionally divides the input-update frequency by this factor |
|
inlineprotected |
calls subject->detach(this);
This method encapsulates the detachment of itself from the IInputSubject. This is useful as this method can be called from within the IActiveQueueInputHandlerDecorator.
|
pure virtual |
This is the main input-handler method that will be automatically called from the given subject each time the subject receives input-data.
This method should be implemented in derived classes to provide a data-handling procedure.
input | the input-data reference |
Implemented in Smart::IEventHandler< EventType >, and Smart::InputTaskTrigger< InputType >.
|
friend |
allows acessing protected members
|
protected |
this is the subject-pointer (can be used in derived classes)