libASPL
|
Handler for control requests to device. More...
#include <aspl/ControlRequestHandler.hpp>
Public Member Functions | |
ControlRequestHandler (const ControlRequestHandler &)=delete | |
ControlRequestHandler & | operator= (const ControlRequestHandler &)=delete |
Start / stop | |
virtual OSStatus | OnStartIO () |
Invoked by Device when the very first client wants to start I/O. If desired, may block to perform all necessary initialization. If error is returned, device reports error to clients. After this call, StopIO() will invoked eventually. After that, StartIO() may be called again. | |
virtual void | OnStopIO () |
Invoked by Device when the last client has stopped I/O. After this call, StartIO() may be called again. | |
Clients | |
virtual std::shared_ptr< Client > | OnAddClient (const ClientInfo &clientInfo) |
Invoked by Device when a new client attaches to it. Override to handle client creation. Should construct a Client bases on provided ClientInfo. | |
virtual void | OnRemoveClient (std::shared_ptr< Client > client) |
Invoked by Device when a client detaches from it. Override to handle client removal. The provided shared pointer is the last reference to the client. | |
Handler for control requests to device.
You may subclass this class if you want to implement custom handling or inject custom Client implementation.
Definition at line 21 of file ControlRequestHandler.hpp.
|
inlinevirtual |
Invoked by Device when a new client attaches to it. Override to handle client creation. Should construct a Client bases on provided ClientInfo.
Definition at line 58 of file ControlRequestHandler.hpp.
|
inlinevirtual |
Invoked by Device when a client detaches from it. Override to handle client removal. The provided shared pointer is the last reference to the client.
Definition at line 66 of file ControlRequestHandler.hpp.
|
inlinevirtual |
Invoked by Device when the very first client wants to start I/O. If desired, may block to perform all necessary initialization. If error is returned, device reports error to clients. After this call, StopIO() will invoked eventually. After that, StartIO() may be called again.
Definition at line 39 of file ControlRequestHandler.hpp.
|
inlinevirtual |
Invoked by Device when the last client has stopped I/O. After this call, StartIO() may be called again.
Definition at line 46 of file ControlRequestHandler.hpp.