The Battle for Wesnoth  1.19.5+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

template<class Socket >
 request (const std::string &reqcmd, config &reqcfg, Socket reqsock, boost::asio::yield_context yield)
 Constructor. More...
 

Public Attributes

const std::string & cmd
 
const configcfg
 
const any_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 56 of file server.hpp.

Constructor & Destructor Documentation

◆ request()

template<class Socket >
campaignd::server::request::request ( const std::string &  reqcmd,
config reqcfg,
Socket  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 85 of file server.hpp.

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 58 of file server.hpp.

◆ sock

const any_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 68 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: