rllib  1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
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