Function data

Summary

#include <src/uvw/loop.h>

(1) template <typename R = void>
    std::shared_ptr< R > data() const

(2) void data(std::shared_ptr< void > uData)

Function overload

Synopsis

#include <src/uvw/loop.h>

template <typename R = void>
std::shared_ptr< R > data() const

Description

Gets user-defined data. uvw won't use this field in any case.

Returns
User-defined data if any, an invalid pointer otherwise.

Source

Lines 369-372 in src/uvw/loop.h.

template<typename R = void>
std::shared_ptr<R> data() const {
    return std::static_pointer_cast<R>(userData);
}

Synopsis

#include <src/uvw/loop.h>

void data(std::shared_ptr< void > uData)

Description

Sets arbitrary data. uvw won't use this field in any case.

Parameters

uData - User-defined arbitrary data.

Source

Lines 124-126 in src/uvw/loop.cpp. Line 378 in src/uvw/loop.h.

UVW_INLINE void Loop::data(std::shared_ptr<void> uData) {
    userData = std::move(uData);
}





Add Discussion as Guest

Log in