跳转至

Class qqmusic::utils::Session

ClassList > qqmusic > utils > Session

上下文

  • #include <session.h>

Public Functions

Type Name
Session () = delete
Session (qqmusic::details::NetworkContext & nc, std::shared_ptr< asio::io_context > ioc_ptr, std::shared_ptr< asio::ssl::context > ssl_ctx_ptr, std::mutex & lock)
构造函数, 正常情况下不应该使用
qqmusic::details::NetworkContext & get_context_ref ()
获取 session 实例的上下文引用
qqmusic::Task< qqmusic::Result< HttpResponse > > perform_request (boost::url_view url, http::request< http::string_body > & req, bool auto_redirecting=true)
发送网络请求, 返回回复报文
void sync_global ()
将上下文的更改写回全局
void update_local ()
将全局的更改同步到本实例

Public Functions Documentation

function Session [1/2]

qqmusic::utils::Session::Session () = delete

function Session [2/2]

构造函数, 正常情况下不应该使用

inline qqmusic::utils::Session::Session (
    qqmusic::details::NetworkContext & nc,
    std::shared_ptr< asio::io_context > ioc_ptr,
    std::shared_ptr< asio::ssl::context > ssl_ctx_ptr,
    std::mutex & lock
) 


function get_context_ref

获取 session 实例的上下文引用

qqmusic::details::NetworkContext & qqmusic::utils::Session::get_context_ref () 


function perform_request

发送网络请求, 返回回复报文

qqmusic::Task< qqmusic::Result< HttpResponse > > qqmusic::utils::Session::perform_request (
    boost::url_view url,
    http::request< http::string_body > & req,
    bool auto_redirecting=true
) 

Parameters:

  • url 请求url
  • req 请求对象
  • auto_redirecting 是否开启自动重定向, 默认true

Returns:

qqmusic::Task<qqmusic::Result<HttpResponse>>, 返回原始报文

Note:

异步函数, 返回Task


function sync_global

将上下文的更改写回全局

void qqmusic::utils::Session::sync_global () 


function update_local

将全局的更改同步到本实例

void qqmusic::utils::Session::update_local () 



The documentation for this class was generated from the following file include/qqmusic/utils/session.h