From 38d80987f3256a22fb4e67d42a9efd286a199867 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Tue, 17 Aug 2010 06:12:30 +0000 Subject: [PATCH] Add PortLinkRef class which use a existing sender and receiver for communication. Suggestion for a better name? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38167 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/app/PortLink.h | 11 ++++++++++- src/kits/app/PortLink.cpp | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/headers/private/app/PortLink.h b/headers/private/app/PortLink.h index a31841792c..a8052ea4cf 100644 --- a/headers/private/app/PortLink.h +++ b/headers/private/app/PortLink.h @@ -1,9 +1,10 @@ /* - * Copyright 2005-2009, Haiku. + * Copyright 2005-2010, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Axel Dörfler, axeld@pinc-software.de + * Clemens Zeidler, haiku@clemens-zeidler.de */ #ifndef _PORT_LINK_H #define _PORT_LINK_H @@ -15,6 +16,7 @@ namespace BPrivate { +/*! Provide a new LinkSender and LinkReceiver for the ServerLink. */ class PortLink : public ServerLink { public: PortLink(port_id sender = -1, @@ -23,6 +25,13 @@ public: }; +/*! Use existing LinkSender and LinkReceiver in ServerLink. */ +class PortLinkRef : public ServerLink { +public: + PortLinkRef(LinkSender* send, LinkReceiver* receive); +}; + + } // namespace BPrivate #endif /* _PORT_LINK_H */ diff --git a/src/kits/app/PortLink.cpp b/src/kits/app/PortLink.cpp index 881a475f7e..c70092e4f1 100644 --- a/src/kits/app/PortLink.cpp +++ b/src/kits/app/PortLink.cpp @@ -1,9 +1,10 @@ /* - * Copyright 2005-2009, Haiku Inc. + * Copyright 2005-2010, Haiku Inc. * Distributed under the terms of the MIT License. * * Authors: * Axel Dörfler, axeld@pinc-software.de + * Clemens Zeidler, haiku@clemens-zeidler.de */ @@ -27,4 +28,11 @@ PortLink::~PortLink() } +PortLinkRef::PortLinkRef(LinkSender* send, LinkReceiver* receive) +{ + fSender = send; + fReceiver = receive; +} + + } // namespace BPrivate