44 #ifndef CCXX_BUFFER_H_ 45 #define CCXX_BUFFER_H_ 47 #ifndef CCXX_THREAD_H_ 50 #ifndef CCXX_STRING_H_ 53 #ifdef CCXX_NAMESPACES 97 virtual size_t onPeek(
void *buf) = 0;
104 virtual size_t onWait(
void *buf) = 0;
111 virtual size_t onPost(
void *buf) = 0;
166 size_t post(
void *buf,
timeout_t timeout = 0);
174 size_t peek(
void *buf);
180 virtual bool isValid(
void);
193 char *buf, *head, *tail;
202 size_t onPeek(
void *buf);
209 size_t onWait(
void *buf);
216 size_t onPost(
void *buf);
283 virtual void final();
289 virtual void startQueue(
void);
296 virtual void stopQueue(
void);
301 virtual void onTimer(
void);
311 virtual void runQueue(
void *data) = 0;
321 ThreadQueue(
const char *
id,
int pri,
size_t stack = 0);
345 void post(
const void *data,
unsigned len);
351 {
return b.wait(o, t);}
355 {
return b.
post(o, t);}
362 #ifdef CCXX_NAMESPACES This is a generic and portable string class.
Definition: string.h:77
Common C++ generic string class.
int HANDLE
Definition: serial.h:60
struct _data * next
Definition: buffer.h:268
static const size_t timeout
value to return when a timed operation returned with a timeout.
Definition: buffer.h:118
#define __EXPORT
Definition: config.h:980
bool started
Definition: buffer.h:274
size_t getUsed(void)
Return the current capacity in use for the buffer.
Definition: buffer.h:144
unsigned long timeout_t
Definition: thread.h:74
Synchronization and threading services.
The buffer class represents an IPC service that is built upon a buffer of fixed capacity that can be ...
Definition: buffer.h:81
size_t put(Buffer &b, void *o, timeout_t t=0)
Definition: buffer.h:354
data_t * last
Definition: buffer.h:276
A conditional variable synchcronization object for one to one and one to many signal and control even...
Definition: thread.h:636
size_t getSize(void)
Return the capacity of the buffer as specified at creation.
Definition: buffer.h:135
size_t peek(void *buf)
Peek at the current content (first object) in the buffer.
unsigned len
Definition: buffer.h:269
size_t peek(Buffer &b, void *o)
Definition: buffer.h:358
String name
Definition: buffer.h:278
size_t post(void *buf, timeout_t timeout=0)
Post an object into the buffer and enable a waiting thread to receive it.
The Mutex class is used to protect a section of code so that at any given time only a single thread c...
Definition: thread.h:186
Every thread of execution in an application is created by instantiating an object of a class derived ...
Definition: thread.h:1093
timeout_t timeout
Definition: buffer.h:273
Somewhat generic queue processing class to establish a producer consumer queue.
Definition: buffer.h:261
A buffer class that holds a known capacity of fixed sized objects defined during creation.
Definition: buffer.h:190
A semaphore is generally used as a synchronization object between multiple threads or to protect a li...
Definition: thread.h:733