rllib  1
rlfifo.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlfifo.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_FIFO_H_
17 #define _RL_FIFO_H_
18 
19 #include "rldefine.h"
20 #include "rlthread.h"
21 
25 class rlFifo
26 {
27 private:
28  typedef struct _MessageList_
29  {
30  char *mes;
31  int len;
33  }MessageList;
34 
35 public:
36  rlFifo(int maxmessages=0);
37  virtual ~rlFifo();
38 
39  enum FifoEnum {
41  };
42 
43  int read(void *buf, int maxlen);
44  int poll();
45  int nmesAvailable();
46  int write(const void *buf, int len);
47  int printf(const char *format, ...);
48 
49 private:
50  int maxmes;
51  int nmes;
55 };
56 
57 #endif
WSEMAPHORE semaphore
Definition: rlfifo.h:53
int nmes
Definition: rlfifo.h:51
struct _MessageList_ * next
Definition: rlfifo.h:32
Definition: rlfifo.h:25
MessageList * list
Definition: rlfifo.h:52
struct rlFifo::_MessageList_ MessageList
FifoEnum
Definition: rlfifo.h:39
HANDLE pthread_mutex_t
Definition: rlwthread.h:70
int read(void *buf, int maxlen)
Definition: rlfifo.cpp:51
int nmesAvailable()
Definition: rlfifo.cpp:99
pthread_mutex_t mutex
Definition: rlfifo.h:54
int maxmes
Definition: rlfifo.h:50
int printf(const char *format,...)
Definition: rlfifo.cpp:142
int poll()
Definition: rlfifo.cpp:93
virtual ~rlFifo()
Definition: rlfifo.cpp:31
int write(const void *buf, int len)
Definition: rlfifo.cpp:105
rlFifo(int maxmessages=0)
Definition: rlfifo.cpp:22