22#include "util/Taggable.hpp"
23#include "web/SubscriptionContextInterface.hpp"
25#include <boost/beast/http.hpp>
26#include <boost/beast/http/status.hpp>
27#include <boost/signals2.hpp>
28#include <boost/signals2/variadic_signal.hpp>
37namespace http = boost::beast::http;
46 boost::system::error_code ec_;
47 bool isAdmin_ =
false;
50 std::string
const clientIp;
51 bool upgraded =
false;
60 :
Taggable(tagFactory), clientIp(std::move(ip))
71 send(std::string&& msg, http::status status = http::status::ok) = 0;
80 send([[maybe_unused]] std::shared_ptr<std::string> msg)
82 throw std::logic_error(
"web server can not send the shared payload");
102 return ec_ != boost::system::error_code{};
A factory for TagDecorator instantiation.
Definition Taggable.hpp:169
A base class that allows attaching a tag decorator to a subclass.
Definition Taggable.hpp:240
Taggable(util::TagDecoratorFactory const &tagFactory)
New Taggable from a specified factory.
Definition Taggable.hpp:250
This namespace implements the web server and related components.
Definition Types.hpp:43
std::shared_ptr< SubscriptionContextInterface > SubscriptionContextPtr
An alias for shared pointer to a SubscriptionContextInterface.
Definition SubscriptionContextInterface.hpp:86
Base class for all connections.
Definition ConnectionBase.hpp:44
virtual SubscriptionContextPtr makeSubscriptionContext(util::TagDecoratorFactory const &factory)=0
Get the subscription context for this connection.
virtual void send(std::shared_ptr< std::string > msg)
Send via shared_ptr of string, that enables SubscriptionManager to publish to clients.
Definition ConnectionBase.hpp:80
ConnectionBase(util::TagDecoratorFactory const &tagFactory, std::string ip)
Create a new connection base.
Definition ConnectionBase.hpp:59
bool isAdmin() const
Indicates whether the connection has admin privileges.
Definition ConnectionBase.hpp:111
virtual void send(std::string &&msg, http::status status=http::status::ok)=0
Send the response to the client.
bool dead()
Indicates whether the connection had an error and is considered dead.
Definition ConnectionBase.hpp:100