ServerLink: move Read*/Attach* method implementations to LinkSender/Receiver
Change-Id: Ib4dec3348b1438bbdfbaf18146d8aebb1978c39c Reviewed-on: https://review.haiku-os.org/c/haiku/+/9631 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
class BGradient;
|
||||
class BString;
|
||||
class BRegion;
|
||||
class BShape;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
@@ -39,6 +40,7 @@ class LinkReceiver {
|
||||
status_t ReadString(BString& string, size_t* _length = NULL);
|
||||
status_t ReadString(char* buffer, size_t bufferSize);
|
||||
status_t ReadRegion(BRegion* region);
|
||||
status_t ReadShape(BShape* shape);
|
||||
status_t ReadGradient(BGradient** gradient);
|
||||
|
||||
template <class Type> status_t Read(Type *data)
|
||||
|
||||
@@ -14,8 +14,13 @@
|
||||
#include <OS.h>
|
||||
|
||||
|
||||
class BGradient;
|
||||
class BRegion;
|
||||
class BShape;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class LinkSender {
|
||||
public:
|
||||
LinkSender(port_id sendport);
|
||||
@@ -35,6 +40,9 @@ class LinkSender {
|
||||
|
||||
status_t Attach(const void *data, size_t size);
|
||||
status_t AttachString(const char *string, int32 maxLength = -1);
|
||||
status_t AttachRegion(const BRegion& region);
|
||||
status_t AttachShape(BShape& shape);
|
||||
status_t AttachGradient(const BGradient& gradient);
|
||||
template <class Type> status_t Attach(const Type& data)
|
||||
{
|
||||
return Attach(&data, sizeof(Type));
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
status_t ReadRegion(BRegion* region);
|
||||
status_t ReadShape(BShape* shape);
|
||||
status_t ReadGradient(BGradient** _gradient);
|
||||
|
||||
|
||||
template <class Type>
|
||||
status_t Read(Type* data);
|
||||
|
||||
@@ -168,6 +168,27 @@ ServerLink::AttachString(const char* string, int32 length)
|
||||
}
|
||||
|
||||
|
||||
inline status_t
|
||||
ServerLink::AttachRegion(const BRegion& region)
|
||||
{
|
||||
return fSender->AttachRegion(region);
|
||||
}
|
||||
|
||||
|
||||
inline status_t
|
||||
ServerLink::AttachShape(BShape& shape)
|
||||
{
|
||||
return fSender->AttachShape(shape);
|
||||
}
|
||||
|
||||
|
||||
inline status_t
|
||||
ServerLink::AttachGradient(const BGradient& gradient)
|
||||
{
|
||||
return fSender->AttachGradient(gradient);
|
||||
}
|
||||
|
||||
|
||||
template<class Type> status_t
|
||||
ServerLink::Attach(const Type& data)
|
||||
{
|
||||
@@ -234,6 +255,27 @@ ServerLink::ReadString(char** _string, size_t* _length)
|
||||
}
|
||||
|
||||
|
||||
inline status_t
|
||||
ServerLink::ReadRegion(BRegion* region)
|
||||
{
|
||||
return fReceiver->ReadRegion(region);
|
||||
}
|
||||
|
||||
|
||||
inline status_t
|
||||
ServerLink::ReadShape(BShape* shape)
|
||||
{
|
||||
return fReceiver->ReadShape(shape);
|
||||
}
|
||||
|
||||
|
||||
inline status_t
|
||||
ServerLink::ReadGradient(BGradient** _gradient)
|
||||
{
|
||||
return fReceiver->ReadGradient(_gradient);
|
||||
}
|
||||
|
||||
|
||||
template <class Type> status_t
|
||||
ServerLink::Read(Type* data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user