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

52 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>
2003-03-06 22:24:45 +00:00
#include <List.h>
2002-07-09 12:24:59 +00:00
class PortLinkData;
class PortLink
{
class ReplyData
2002-09-30 22:34:20 +00:00
{
public:
ReplyData(void) { code=0; buffersize=0; buffer=NULL; }
~ReplyData(void) { if(buffer) delete buffer; }
2002-09-30 22:34:20 +00:00
int32 code;
ssize_t buffersize;
int8 *buffer;
};
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(const void *data, size_t size);
2002-09-30 22:34:20 +00:00
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;
bool port_ok;
2003-03-06 22:24:45 +00:00
BList *attachlist;
2002-07-09 12:24:59 +00:00
};
2003-03-06 22:24:45 +00:00
#endif