ladybird/Libraries/LibCore/CTCPSocket.h
Andreas Kling 4298ba25c3 LibCore: Convert CTCPSocket to ObjectPtr, add construct() helper
The C_OBJECT macro now also inserts a static construct(...) helper into
the class. Now we can make the constructor(s) private and instead call:

    auto socket = CTCPSocket::construct(arguments);

construct() returns an ObjectPtr<T>, which we'll later switch to being
a NonnullRefPtr<T>, once everything else in in place for ref-counting.
2019-09-21 15:25:08 +02:00

17 lines
312 B
C++

#pragma once
#include <AK/Badge.h>
#include <LibCore/CSocket.h>
class CTCPServer;
class CTCPSocket final : public CSocket {
C_OBJECT(CTCPSocket)
public:
virtual ~CTCPSocket() override;
private:
CTCPSocket(int fd, CObject* parent = nullptr);
explicit CTCPSocket(CObject* parent = nullptr);
};