rllib
1
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
lib
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
;
32
struct
_MessageList_
*
next
;
33
}
MessageList
;
34
35
public
:
36
rlFifo
(
int
maxmessages=0);
37
virtual
~rlFifo
();
38
39
enum
FifoEnum
{
40
DATA_AVAILABLE
=-1,
NO_DATA_AVAILABLE
=-2,
MESSAGE_TO_BIG
=-3,
FIFO_FULL
=-4
41
};
42
43
int
read
(
void
*buf,
int
maxlen);
44
int
poll
();
45
int
write
(
const
void
*buf,
int
len);
46
int
printf
(
const
char
*format, ...);
47
48
private
:
49
int
maxmes
;
50
int
nmes
;
51
MessageList
*
list
;
52
WSEMAPHORE
semaphore
;
53
pthread_mutex_t
mutex
;
54
};
55
56
#endif
Generated by
1.8.2