The Battle for Wesnoth  1.15.12+dev
Public Member Functions | Public Attributes | List of all members
campaignd::server::request Struct Reference

Client request information object. More...

#include <server.hpp>

Public Member Functions

 request (const std::string &reqcmd, config &reqcfg, socket_ptr reqsock, boost::asio::yield_context yield)
 Constructor. More...
 

Public Attributes

const std::string & cmd
 
const configcfg
 
const socket_ptr sock
 
const std::string addr
 
boost::asio::yield_context yield
 context of the coroutine the request is executed in async operations on sock can use it instead of a handler. More...
 

Detailed Description

Client request information object.

Contains data and metadata associated with a single request from a remote add-ons client, in a light-weight format for passing to request handlers.

Definition at line 55 of file server.hpp.

Constructor & Destructor Documentation

◆ request()

campaignd::server::request::request ( const std::string &  reqcmd,
config reqcfg,
socket_ptr  reqsock,
boost::asio::yield_context  yield 
)
inline

Constructor.

Parameters
reqcmdRequest command.
reqcfgRequest WML body.
reqsockClient socket that initiated the request.
yieldThe function will suspend on write operation using this yield context
Note
Neither reqcmd nor reqcfg are copied into instances, so they are required to exist for as long as every request instance that uses them. Furthermore, reqcfg MUST NOT REFER TO A CONST OBJECT, since some code may modify it directly for performance reasons.

Definition at line 83 of file server.hpp.

References campaignd::server::operator<<.

Member Data Documentation

◆ addr

const std::string campaignd::server::request::addr

◆ cfg

const config& campaignd::server::request::cfg

◆ cmd

const std::string& campaignd::server::request::cmd

Definition at line 57 of file server.hpp.

Referenced by campaignd::operator<<().

◆ sock

const socket_ptr campaignd::server::request::sock

◆ yield

boost::asio::yield_context campaignd::server::request::yield

context of the coroutine the request is executed in async operations on sock can use it instead of a handler.

Definition at line 67 of file server.hpp.

Referenced by campaignd::server::handle_request_campaign(), and campaignd::server::handle_request_campaign_hash().


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