uvw 3.4.0
Loading...
Searching...
No Matches
uvw::resource< T, U, E > Class Template Reference

Common class for almost all the resources available in uvw. More...

#include <resource.hpp>

Inheritance diagram for uvw::resource< T, U, E >:
Collaboration diagram for uvw::resource< T, U, E >:

Public Member Functions

template<typename R = void>
std::shared_ptr< R > data () const
 Gets user-defined data. uvw won't use this field in any case.
void data (std::shared_ptr< void > udata)
 Sets arbitrary data. uvw won't use this field in any case.
Public Member Functions inherited from uvw::uv_type< U >
loopparent () const noexcept
 Gets the loop from which the resource was originated.
const U * raw () const noexcept
 Gets the underlying raw data structure.
U * raw () noexcept
 Gets the underlying raw data structure.
Public Member Functions inherited from uvw::emitter< T, E... >
void on (listener_t< Type > f)
 Registers a long-lived listener with the event emitter.
void reset () noexcept
 Disconnects the listener for the given event type.
bool has () const noexcept
 Checks if there is a listener registered for the specific event.

Detailed Description

template<typename T, typename U, typename... E>
class uvw::resource< T, U, E >

Common class for almost all the resources available in uvw.

This is the base class for handles and requests.

Definition at line 18 of file resource.hpp.

Member Function Documentation

◆ data() [1/2]

template<typename T, typename U, typename... E>
template<typename R = void>
std::shared_ptr< R > uvw::resource< T, U, E >::data ( ) const
inline

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

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

Definition at line 47 of file resource.hpp.

◆ data() [2/2]

template<typename T, typename U, typename... E>
void uvw::resource< T, U, E >::data ( std::shared_ptr< void > udata)
inline

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

Parameters
udataUser-defined arbitrary data.

Definition at line 55 of file resource.hpp.


The documentation for this class was generated from the following file: