IRSOL
C++ code implementing socket server for interacting with Baumer camera.
context.hpp
Go to the documentation of this file.
1
13#pragma once
14
15#include "irsol/types.hpp"
16
17#include <memory>
18
19namespace irsol {
20namespace server {
21// Forward declaration
22class App;
23class ClientSession;
24
25namespace handlers {
26
34struct Context
35{
39
45 virtual std::shared_ptr<irsol::server::ClientSession> getSession(
47
55 const std::optional<irsol::types::client_id_t>& excludeClient = std::nullopt);
56};
57}
58}
59}
Main server application that manages client connections and camera streaming.
Definition app.hpp:46
std::variant< Success, BinaryDataBuffer, ImageBinaryData, ColorImageBinaryData, Error > OutMessage
Variant type representing any outgoing message.
Definition variants.hpp:149
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Definition factory.hpp:28
std::string client_id_t
Represents a unique client identifier. Typically used to identify connected clients by string IDs.
Definition types.hpp:55
Context object passed to all handler classes.
Definition context.hpp:35
void broadcastMessage(protocol::OutMessage &&message, const std::optional< irsol::types::client_id_t > &excludeClient=std::nullopt)
Broadcasts a message to all clients.
Definition base.cpp:15
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.
Definition base.cpp:9
App & app
Reference to application instance.
Definition context.hpp:38
Core type definitions for networking, time handling, and protocol values used throughout the irsol li...