Function getContext

Synopsis

#include <lib/inc/drogon/WebSocketConnection.h>

template <typename T>
std::shared_ptr< T > getContext() const

Description

Get custom data from the connection.

Template Parameters

T - The type of the data

Returns
std::shared_ptr<T> The smart pointer to the data object.

Mentioned in

Source

Lines 167-171 in lib/inc/drogon/WebSocketConnection.h.

template <typename T>
std::shared_ptr<T> getContext() const
{
    return std::static_pointer_cast<T>(contextPtr_);
}





Add Discussion as Guest

Log in