minor changes
This commit is contained in:
parent
e5f2e4bded
commit
d030c5c6f6
@ -19,13 +19,13 @@ class BaseResource {
|
||||
protected:
|
||||
template<typename T>
|
||||
explicit BaseResource(HandleType<T>, std::shared_ptr<Loop> r)
|
||||
: ref{std::move(r)}, res{std::make_shared<T>()}
|
||||
: pLoop{std::move(r)}, handle{std::make_shared<T>()}
|
||||
{ }
|
||||
|
||||
template<typename T>
|
||||
T* get() const noexcept { return reinterpret_cast<T*>(res.get()); }
|
||||
T* get() const noexcept { return reinterpret_cast<T*>(handle.get()); }
|
||||
|
||||
uv_loop_t* parent() const noexcept { return ref->loop.get(); }
|
||||
uv_loop_t* parent() const noexcept { return pLoop->loop.get(); }
|
||||
|
||||
public:
|
||||
explicit BaseResource(const BaseResource &) = delete;
|
||||
@ -34,7 +34,7 @@ public:
|
||||
void operator=(const BaseResource &) = delete;
|
||||
void operator=(BaseResource &&) = delete;
|
||||
|
||||
std::shared_ptr<Loop> loop() const noexcept { return ref; }
|
||||
std::shared_ptr<Loop> loop() const noexcept { return pLoop; }
|
||||
|
||||
bool active() const noexcept { return !(uv_is_active(get<uv_handle_t>()) == 0); }
|
||||
bool closing() const noexcept { return !(uv_is_closing(get<uv_handle_t>()) == 0); }
|
||||
@ -44,8 +44,8 @@ public:
|
||||
bool referenced() const noexcept { return !(uv_has_ref(get<uv_handle_t>()) == 0); }
|
||||
|
||||
private:
|
||||
std::shared_ptr<Loop> ref;
|
||||
std::shared_ptr<void> res;
|
||||
std::shared_ptr<Loop> pLoop;
|
||||
std::shared_ptr<void> handle;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user