This class implements the Subject (also called Model) part of the Observer design pattern for implementing a uniform shutdown procedure for all component's resources.
More...
#include <smartIShutdownObserver.h>
This class implements the Subject (also called Model) part of the Observer design pattern for implementing a uniform shutdown procedure for all component's resources.
An IComponent implements this interface to trigger all attached IShutdownObserver instances just before the IComponent finally shuts down. Each communication pattern (clients and servers) and all user-defined Tasks attached to an IComponent should implement the counter-part IShutdownObserver interface (i.e. the on_shutdown() method) thus providing individual cleanup procedures/strategies.
◆ ShutdownSubject()
Smart::ShutdownSubject::ShutdownSubject |
( |
| ) |
|
|
inline |
◆ ~ShutdownSubject()
virtual Smart::ShutdownSubject::~ShutdownSubject |
( |
| ) |
|
|
inlinevirtual |
◆ attach()
◆ detach()
◆ notify_sutdown()
virtual void Smart::ShutdownSubject::notify_sutdown |
( |
| ) |
|
|
inlineprotectedvirtual |
Notifies all attached IShutdownObserver instances about an upcoming shutdown.
An instance of IComponent should call this method just before the component itself cleans-up its own internal resources. In this way, all the attached entities (such as client- and server-ports, as well as tasks) can clean-up their individual internal resources before the component invalidates its own internal resources. This effectively prevents nullpointer exceptions.
◆ IShutdownObserver
The documentation for this class was generated from the following file: