libASPL
Loading...
Searching...
No Matches
aspl::ControlRequestHandler Class Reference

Handler for control requests to device. More...

#include <aspl/ControlRequestHandler.hpp>

Public Member Functions

 ControlRequestHandler (const ControlRequestHandler &)=delete
 
ControlRequestHandleroperator= (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< ClientOnAddClient (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.
 

Detailed Description

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.

Member Function Documentation

◆ OnAddClient()

virtual std::shared_ptr< Client > aspl::ControlRequestHandler::OnAddClient ( const ClientInfo & clientInfo)
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.

◆ OnRemoveClient()

virtual void aspl::ControlRequestHandler::OnRemoveClient ( std::shared_ptr< Client > client)
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.

◆ OnStartIO()

virtual OSStatus aspl::ControlRequestHandler::OnStartIO ( )
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.

◆ OnStopIO()

virtual void aspl::ControlRequestHandler::OnStopIO ( )
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.


The documentation for this class was generated from the following file: