Function resource

Synopsis

#include <src/uvw/loop.h>

template <typename R, typename... Args>
std::shared_ptr< R > resource(Args &&... args)

Description

Creates resources of any type.

This should be used as a default method to create resources.
The arguments are the ones required for the specific resource.

Use it as loop->resource<uvw::TimerHandle>().

Returns
A pointer to the newly created resource.

Mentioned in

Source

Lines 165-168 in src/uvw/loop.h.

template<typename R, typename... Args>
std::shared_ptr<R> resource(Args&&... args) {
    return create_resource<R>(0, std::forward<Args>(args)...);
}





Add Discussion as Guest

Log in