Function getThreadData

Summary

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

(1) ValueType & getThreadData()

(2) const ValueType & getThreadData() const

Function overload

Synopsis

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

ValueType & getThreadData()

Description

Get the thread storage asociate with the current thread.

This function may only be called in a request handler

Source

Lines 97-102 in lib/inc/drogon/IOThreadStorage.h.

inline ValueType &getThreadData()
{
    size_t idx = app().getCurrentThreadIndex();
    assert(idx < storage_.size());
    return storage_[idx];
}

Synopsis

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

const ValueType & getThreadData() const

Description

No description yet.

Source

Lines 104-109 in lib/inc/drogon/IOThreadStorage.h.

inline const ValueType &getThreadData() const
{
    size_t idx = app().getCurrentThreadIndex();
    assert(idx < storage_.size());
    return storage_[idx];
}





Add Discussion as Guest

Log in