![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Context object passed to all handler classes. More...
#include <context.hpp>
Public Member Functions | |
| Context (App &app) | |
| virtual std::shared_ptr< irsol::server::ClientSession > | getSession (const irsol::types::client_id_t &clientId) |
| Retrieves the client's session associated with the given clientId. | |
| void | broadcastMessage (protocol::OutMessage &&message, const std::optional< irsol::types::client_id_t > &excludeClient=std::nullopt) |
| Broadcasts a message to all clients. | |
Public Attributes | |
| App & | app |
| Reference to application instance. | |
Context object passed to all handler classes.
Provides access to the application instance and utility methods for retrieving client sessions and broadcasting messages.
Definition at line 34 of file context.hpp.
|
inline |
Definition at line 36 of file context.hpp.
| void irsol::server::handlers::Context::broadcastMessage | ( | protocol::OutMessage && | message, |
| const std::optional< irsol::types::client_id_t > & | excludeClient = std::nullopt |
||
| ) |
Broadcasts a message to all clients.
| message | The outbound message to broadcast. |
| excludeClient | Optional client to exclude from the broadcast. |
Definition at line 15 of file base.cpp.
|
virtual |
Retrieves the client's session associated with the given clientId.
| clientId | The client identifier. |
Definition at line 9 of file base.cpp.
| App& irsol::server::handlers::Context::app |
Reference to application instance.
Definition at line 38 of file context.hpp.