uvw  2.11.0
Public Member Functions | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for uvw::Resource< T, U >:
Collaboration graph
[legend]

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. More...
 
void data (std::shared_ptr< void > uData)
 Sets arbitrary data. uvw won't use this field in any case. More...
 
- Public Member Functions inherited from uvw::UnderlyingType< T, U >
Looploop () const noexcept
 Gets the loop from which the resource was originated. More...
 
const U * raw () const noexcept
 Gets the underlying raw data structure. More...
 
U * raw () noexcept
 Gets the underlying raw data structure. More...
 
- 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. More...
 
template<typename E >
Connection< E > once (Listener< E > f)
 Registers a short-lived listener with the event emitter. More...
 
template<typename E >
void erase (Connection< E > conn) noexcept
 Disconnects a listener from the event emitter. More...
 
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. More...
 
bool empty () const noexcept
 Checks if there are listeners registered with the event emitter. More...
 

Additional Inherited Members

- 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. More...
 

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 20 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 52 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 60 of file resource.hpp.


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