commit
0477cb1117
@ -83,13 +83,12 @@ public:
|
||||
|
||||
/**
|
||||
* @brief Creates a new resource of the given type.
|
||||
* @param loop A pointer to the loop from which the handle generated.
|
||||
* @param args Arguments to be forwarded to the actual constructor (if any).
|
||||
* @return A pointer to the newly created resource.
|
||||
*/
|
||||
template<typename... Args>
|
||||
static std::shared_ptr<T> create(std::shared_ptr<Loop> loop, Args&&... args) {
|
||||
return std::make_shared<T>(ConstructorAccess{0}, std::move(loop), std::forward<Args>(args)...);
|
||||
static std::shared_ptr<T> create(Args&&... args) {
|
||||
return std::make_shared<T>(ConstructorAccess{0}, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -50,9 +50,7 @@ public:
|
||||
using IPv4 = uvw::IPv4;
|
||||
using IPv6 = uvw::IPv6;
|
||||
|
||||
explicit TcpHandle(ConstructorAccess ca, std::shared_ptr<Loop> ref)
|
||||
: StreamHandle{std::move(ca), std::move(ref)}, tag{DEFAULT}, flags{}
|
||||
{ }
|
||||
using StreamHandle::StreamHandle;
|
||||
|
||||
explicit TcpHandle(ConstructorAccess ca, std::shared_ptr<Loop> ref, unsigned int f)
|
||||
: StreamHandle{std::move(ca), std::move(ref)}, tag{FLAGS}, flags{f}
|
||||
@ -220,8 +218,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
enum { DEFAULT, FLAGS } tag;
|
||||
unsigned int flags;
|
||||
enum { DEFAULT, FLAGS } tag{DEFAULT};
|
||||
unsigned int flags{};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -135,9 +135,7 @@ public:
|
||||
using IPv4 = uvw::IPv4;
|
||||
using IPv6 = uvw::IPv6;
|
||||
|
||||
explicit UDPHandle(ConstructorAccess ca, std::shared_ptr<Loop> ref)
|
||||
: Handle{std::move(ca), std::move(ref)}, tag{DEFAULT}, flags{}
|
||||
{ }
|
||||
using Handle::Handle;
|
||||
|
||||
explicit UDPHandle(ConstructorAccess ca, std::shared_ptr<Loop> ref, unsigned int f)
|
||||
: Handle{std::move(ca), std::move(ref)}, tag{FLAGS}, flags{f}
|
||||
@ -371,8 +369,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
enum { DEFAULT, FLAGS } tag;
|
||||
unsigned int flags;
|
||||
enum { DEFAULT, FLAGS } tag{DEFAULT};
|
||||
unsigned int flags{};
|
||||
};
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user