BSession is no longer a parent class
Removal of deprecated reply functions Global protocol change - reply port is at the end of data, not the beginning PortLink still uses the BSession messaging style git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4933 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,42 +1,28 @@
|
|||||||
#ifndef _PORTLINK_H
|
#ifndef _PORTLINK_H
|
||||||
#define _PORTLINK_H
|
#define _PORTLINK_H
|
||||||
|
|
||||||
|
|
||||||
#include <BeBuild.h>
|
#include <BeBuild.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
#include "Session.h"
|
|
||||||
|
|
||||||
class PortMessage;
|
class PortMessage;
|
||||||
|
|
||||||
class PortLink : public BSession{
|
class PortLink
|
||||||
public:
|
|
||||||
class ReplyData
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ReplyData(void) { code=0; buffersize=0; buffer=NULL; }
|
|
||||||
~ReplyData(void) { if(buffer) delete buffer; }
|
|
||||||
|
|
||||||
int32 code;
|
|
||||||
ssize_t buffersize;
|
|
||||||
int8 *buffer;
|
|
||||||
};
|
|
||||||
|
|
||||||
PortLink(port_id port);
|
PortLink(port_id port);
|
||||||
PortLink(const PortLink &link);
|
PortLink(const PortLink &link);
|
||||||
virtual ~PortLink() { }
|
virtual ~PortLink(void) { }
|
||||||
|
|
||||||
void SetOpCode(int32 code);
|
void SetOpCode(int32 code);
|
||||||
|
|
||||||
void SetPort(port_id port);
|
void SetPort(port_id port);
|
||||||
port_id GetPort();
|
port_id GetPort();
|
||||||
|
|
||||||
status_t Flush(bigtime_t timeout = B_INFINITE_TIMEOUT);
|
status_t Flush(bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||||
int8* FlushWithReply( int32 *code, status_t *status, ssize_t *buffersize,
|
|
||||||
bigtime_t timeout=B_INFINITE_TIMEOUT );
|
|
||||||
status_t FlushWithReply( PortLink::ReplyData *data,bigtime_t timeout=B_INFINITE_TIMEOUT );
|
|
||||||
status_t FlushWithReply(PortMessage *msg,bigtime_t timeout=B_INFINITE_TIMEOUT);
|
status_t FlushWithReply(PortMessage *msg,bigtime_t timeout=B_INFINITE_TIMEOUT);
|
||||||
|
|
||||||
status_t Attach(const void *data, size_t size);
|
|
||||||
void MakeEmpty();
|
void MakeEmpty();
|
||||||
|
status_t Attach(const void *data, size_t size);
|
||||||
template <class Type> status_t Attach(Type data)
|
template <class Type> status_t Attach(Type data)
|
||||||
{
|
{
|
||||||
int32 size = sizeof(Type);
|
int32 size = sizeof(Type);
|
||||||
@@ -51,8 +37,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool port_ok;
|
bool port_ok;
|
||||||
|
port_id fSendPort;
|
||||||
|
port_id fReceivePort;
|
||||||
|
char *fSendBuffer;
|
||||||
|
int32 fSendPosition;
|
||||||
|
int32 fSendCode;
|
||||||
};
|
};
|
||||||
|
|
||||||
//extern _IMPEXP_BE _PortLink_ *main_session;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user