uvw 2.12.1
Loading...
Searching...
No Matches
uvw::Resource< T, U > Class Template Reference

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

#include <resource.hpp>

Inheritance diagram for uvw::Resource< T, U >:
Collaboration diagram for uvw::Resource< T, U >:

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::UnderlyingType< T, U >
Looploop () 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 >
template<typename E >
Connection< E > on (Listener< E > f)
 Registers a long-lived listener with the event emitter.
 
template<typename E >
Connection< E > once (Listener< E > f)
 Registers a short-lived listener with the event emitter.
 
template<typename E >
void erase (Connection< E > conn) noexcept
 Disconnects a listener from the event emitter.
 
template<typename E >
void clear () noexcept
 Disconnects all the listeners for the given event type.
 
void clear () noexcept
 Disconnects all the listeners.
 
template<typename E >
bool empty () const noexcept
 Checks if there are listeners registered for the specific event.
 
bool empty () const noexcept
 Checks if there are listeners registered with the event emitter.
 

Additional Inherited Members

- Public Types inherited from uvw::Emitter< T >
- Static Public Member Functions inherited from uvw::UnderlyingType< T, U >
template<typename... Args>
static std::shared_ptr< T > create (Args &&...args)
 Creates a new resource of the given type.
 
- Protected Member Functions inherited from uvw::UnderlyingType< T, U >
- Protected Member Functions inherited from uvw::Emitter< T >

Detailed Description

template<typename T, typename U>
class uvw::Resource< T, U >

Common class for almost all the resources available in uvw.

This is the base class for handles and requests.

Definition at line 17 of file resource.hpp.

Member Function Documentation

◆ data() [1/2]

template<typename T , typename U >
template<typename R = void>
std::shared_ptr< R > uvw::Resource< T, U >::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 48 of file resource.hpp.

◆ data() [2/2]

template<typename T , typename U >
void uvw::Resource< T, U >::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 56 of file resource.hpp.


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