summaryrefslogtreecommitdiff
path: root/Libraries/LibIPC
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-02 12:34:39 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-02 15:15:30 +0100
commit2d39da5405a4527e91e853ddb1e56a539c96c6c1 (patch)
tree342f5d553c844f05b550510de27d5b7c937daf90 /Libraries/LibIPC
parentb7e3810b5c3d7e52217e70eed61132d9f670648d (diff)
downloadserenity-2d39da5405a4527e91e853ddb1e56a539c96c6c1.zip
LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being consistent about how this stuff works. The new convention is: - "LibFoo" is a userspace library that provides the "Foo" namespace. That's it :^) This was pretty tedious to convert and I didn't even start on LibGUI yet. But it's coming up next.
Diffstat (limited to 'Libraries/LibIPC')
-rw-r--r--Libraries/LibIPC/IClientConnection.h16
-rw-r--r--Libraries/LibIPC/IServerConnection.h12
2 files changed, 14 insertions, 14 deletions
diff --git a/Libraries/LibIPC/IClientConnection.h b/Libraries/LibIPC/IClientConnection.h
index e20219cbbb..7542d7b78c 100644
--- a/Libraries/LibIPC/IClientConnection.h
+++ b/Libraries/LibIPC/IClientConnection.h
@@ -40,7 +40,7 @@
#include <sys/types.h>
#include <unistd.h>
-class IEvent : public CEvent {
+class IEvent : public Core::Event {
public:
enum Type {
Invalid = 2000,
@@ -48,7 +48,7 @@ public:
};
IEvent() {}
explicit IEvent(Type type)
- : CEvent(type)
+ : Core::Event(type)
{
}
};
@@ -74,9 +74,9 @@ NonnullRefPtr<T> new_client_connection(Args&&... args)
}
template<typename Endpoint>
-class IClientConnection : public CObject {
+class IClientConnection : public Core::Object {
public:
- IClientConnection(Endpoint& endpoint, CLocalSocket& socket, int client_id)
+ IClientConnection(Endpoint& endpoint, Core::LocalSocket& socket, int client_id)
: m_endpoint(endpoint)
, m_socket(socket)
, m_client_id(client_id)
@@ -133,7 +133,7 @@ public:
ssize_t nread = recv(m_socket->fd(), buffer, sizeof(buffer), MSG_DONTWAIT);
if (nread == 0 || (nread == -1 && errno == EAGAIN)) {
if (bytes.is_empty()) {
- CEventLoop::current().post_event(*this, make<IDisconnectedEvent>(client_id()));
+ Core::EventLoop::current().post_event(*this, make<IDisconnectedEvent>(client_id()));
return;
}
break;
@@ -184,7 +184,7 @@ public:
virtual void die() = 0;
protected:
- void event(CEvent& event) override
+ void event(Core::Event& event) override
{
if (event.type() == IEvent::Disconnected) {
int client_id = static_cast<const IDisconnectedEvent&>(event).client_id();
@@ -193,12 +193,12 @@ protected:
return;
}
- CObject::event(event);
+ Core::Object::event(event);
}
private:
Endpoint& m_endpoint;
- RefPtr<CLocalSocket> m_socket;
+ RefPtr<Core::LocalSocket> m_socket;
int m_client_id { -1 };
int m_client_pid { -1 };
};
diff --git a/Libraries/LibIPC/IServerConnection.h b/Libraries/LibIPC/IServerConnection.h
index 31b7ce7f56..90dfbe7730 100644
--- a/Libraries/LibIPC/IServerConnection.h
+++ b/Libraries/LibIPC/IServerConnection.h
@@ -41,12 +41,12 @@
#include <unistd.h>
template<typename LocalEndpoint, typename PeerEndpoint>
-class IServerConnection : public CObject {
+class IServerConnection : public Core::Object {
public:
IServerConnection(LocalEndpoint& local_endpoint, const StringView& address)
: m_local_endpoint(local_endpoint)
- , m_connection(CLocalSocket::construct(this))
- , m_notifier(CNotifier::construct(m_connection->fd(), CNotifier::Read, this))
+ , m_connection(Core::LocalSocket::construct(this))
+ , m_notifier(Core::Notifier::construct(m_connection->fd(), Core::Notifier::Read, this))
{
// We want to rate-limit our clients
m_connection->set_blocking(true);
@@ -57,7 +57,7 @@ public:
int retries = 100000;
while (retries) {
- if (m_connection->connect(CSocketAddress::local(address))) {
+ if (m_connection->connect(Core::SocketAddress::local(address))) {
break;
}
@@ -193,8 +193,8 @@ private:
}
LocalEndpoint& m_local_endpoint;
- RefPtr<CLocalSocket> m_connection;
- RefPtr<CNotifier> m_notifier;
+ RefPtr<Core::LocalSocket> m_connection;
+ RefPtr<Core::Notifier> m_notifier;
Vector<OwnPtr<IMessage>> m_unprocessed_messages;
int m_server_pid { -1 };
int m_my_client_id { -1 };