rllib  1
rlmailbox.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlmailbox.h - description
3  -------------------
4  begin : Tue Jan 02 2001
5  copyright : (C) 2001 by R. Lehrig
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
16 #ifndef _RL_MAILBOX_H_
17 #define _RL_MAILBOX_H_
18 
19 #include "rldefine.h"
20 
29 class rlMailbox
30 {
31 public:
33  {
38  WAIT = 1,
39  NOWAIT = 0,
41  MAX_MAILBOX = 256*256,
43  OK = 2,
47  };
48 
52  rlMailbox(const char *name);
53 
57  virtual ~rlMailbox();
58 
65  int write(const void *buf, int len);
66 
73  int printf(const char *format, ...);
74 
81  int read(void *buf, int maxlen, int wait=WAIT);
82 
86  int setReadBufferSize(int size);
87 
94  const char *read(int wait=WAIT);
95 
102  int write(const char *message);
103 
107  void clear();
108 
114  int status;
115 
119  char *name;
120 
121 private:
122  int chanid;
124  char *buffer;
125 };
126 
127 #endif
char * buffer
Definition: rlmailbox.h:124
void clear()
Definition: rlmailbox.cpp:337
int setReadBufferSize(int size)
Definition: rlmailbox.cpp:357
int printf(const char *format,...)
Definition: rlmailbox.cpp:344
int status
Definition: rlmailbox.h:114
rlMailbox(const char *name)
Definition: rlmailbox.cpp:55
virtual ~rlMailbox()
Definition: rlmailbox.cpp:134
int read(void *buf, int maxlen, int wait=WAIT)
Definition: rlmailbox.cpp:224
char * name
Definition: rlmailbox.h:119
int buffer_size
Definition: rlmailbox.h:123
int write(const void *buf, int len)
Definition: rlmailbox.cpp:149
return codes for write()
Definition: rlmailbox.h:35
int chanid
Definition: rlmailbox.h:122
wait parameter for read()
Definition: rlmailbox.h:38
status:
Definition: rlmailbox.h:43
maximum mailbox length
Definition: rlmailbox.h:41