minor changes

This commit is contained in:
Michele Caini 2017-08-01 17:35:59 +02:00
parent 795c6a8032
commit cef596e908
3 changed files with 8 additions and 12 deletions

View File

@ -13,14 +13,13 @@ namespace uvw {
/**
* @brief Common class for almost all the resources available in `uvw`.
*
* This is the base class for handles and requests.<br/>
* Beyond `UnderlyingType`, it stores a UserData and a self-referencing shared_ptr.
* This is the base class for handles and requests.
*/
template<typename T, typename U>
class Resource: public UnderlyingType<T, U>, public Emitter<T>,
public std::enable_shared_from_this<T> {
class Resource: public UnderlyingType<T, U>, public Emitter<T>, public std::enable_shared_from_this<T> {
protected:
using ConstructorAccess = typename UnderlyingType<T, U>::ConstructorAccess;
auto parent() const noexcept {
return this->loop().loop.get();
}
@ -38,8 +37,7 @@ protected:
}
public:
explicit Resource(typename UnderlyingType<T, U>::ConstructorAccess ca,
std::shared_ptr<Loop> ref)
explicit Resource(ConstructorAccess ca, std::shared_ptr<Loop> ref)
: UnderlyingType<T, U>{std::move(ca), std::move(ref)},
Emitter<T>{},
std::enable_shared_from_this<T>{}

View File

@ -35,8 +35,7 @@ public:
using Task = InternalTask;
using Type = uv_thread_t;
explicit Thread(ConstructorAccess ca, std::shared_ptr<Loop> ref,
InternalTask t, std::shared_ptr<void> d = nullptr) noexcept
explicit Thread(ConstructorAccess ca, std::shared_ptr<Loop> ref, InternalTask t, std::shared_ptr<void> d = nullptr) noexcept
: UnderlyingType{std::move(ca), std::move(ref)}, data{std::move(d)}, task{std::move(t)}
{}

View File

@ -11,10 +11,9 @@ namespace uvw {
/**
* @brief Internal `class uvw::UnderlyingType`
* @brief Wrapper class for underlying types.
*
* A base resource class to define the `create` method in one place.<br/>
* It mainly acts as a wrapper around a data structure of `libuv`.
* It acts mainly as a wrapper around data structures of the underlying library.
*/
template<typename T, typename U>
class UnderlyingType {