Function setThreadData

Summary

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

(1) void setThreadData(const ValueType &newData)

(2) void setThreadData(ValueType &&newData)

Function overload

Synopsis

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

void setThreadData(const ValueType &newData)

Description

Sets the thread data for the current thread.

This function may only be called in a request handler

Source

Lines 120-125 in lib/inc/drogon/IOThreadStorage.h.

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

Synopsis

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

void setThreadData(ValueType &&newData)

Description

No description yet.

Source

Lines 127-132 in lib/inc/drogon/IOThreadStorage.h.

inline void setThreadData(ValueType &&newData)
{
    size_t idx = app().getCurrentThreadIndex();
    assert(idx < storage_.size());
    storage_[idx] = std::move(newData);
}





Add Discussion as Guest

Log in to DocsForge