Files
haiku-beta6/headers/private/app/PortLink.h
T

54 lines
1.2 KiB
C++
Raw Normal View History

2002-07-09 12:24:59 +00:00
#ifndef _PORTLINK_H_
#define _PORTLINK_H_
#include <Errors.h>
#include <OS.h>
#include <SupportDefs.h>
#include <Rect.h>
#ifndef _PORTLINK_BUFFERSIZE
#define _PORTLINK_MAX_ATTACHMENTS 50
#endif
class PortLinkData;
class PortLink
{
2002-09-30 22:34:20 +00:00
typedef struct
{
int32 code;
ssize_t buffersize;
int8 *buffer;
} ReplyData;
2002-07-09 12:24:59 +00:00
public:
PortLink(port_id port);
2002-09-30 22:34:20 +00:00
PortLink(const PortLink &link);
2002-07-09 12:24:59 +00:00
~PortLink(void);
void SetOpCode(int32 code);
void SetPort(port_id port);
port_id GetPort(void);
2002-09-30 22:34:20 +00:00
status_t Flush(bigtime_t timeout=B_INFINITE_TIMEOUT);
2002-07-09 12:24:59 +00:00
int8* FlushWithReply(int32 *code, status_t *status, ssize_t *buffersize,
bigtime_t timeout=B_INFINITE_TIMEOUT);
2002-09-30 22:34:20 +00:00
status_t FlushWithReply(PortLink::ReplyData *data,bigtime_t timeout=B_INFINITE_TIMEOUT);
status_t Attach(void *data, size_t size);
status_t Attach(int32 data);
status_t Attach(int16 data);
status_t Attach(int8 data);
status_t Attach(float data);
status_t Attach(bool data);
status_t Attach(BRect data);
status_t Attach(BPoint data);
2002-07-09 12:24:59 +00:00
void MakeEmpty(void);
protected:
void FlattenData(int8 **buffer,int32 *size);
port_id target, replyport;
2002-09-30 22:34:20 +00:00
int32 opcode;
uint32 bufferlength,capacity;
2002-07-09 12:24:59 +00:00
int num_attachments;
2002-09-30 22:34:20 +00:00
bool port_ok;
2002-07-09 12:24:59 +00:00
PortLinkData *attachments[_PORTLINK_MAX_ATTACHMENTS];
};
#endif