Fork of Smoothie to port to mbed non-LPC targets.
Fork of Smoothie by
libs/Network/uip/CommandQueue.h@2:1df0b61d3b5a, 2014-02-28 (annotated)
- Committer:
- Michael J. Spencer
- Date:
- Fri Feb 28 18:52:52 2014 -0800
- Revision:
- 2:1df0b61d3b5a
Update to latest Smoothie.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Michael J. Spencer |
2:1df0b61d3b5a | 1 | #ifndef _COMMANDQUEUE_H_ |
Michael J. Spencer |
2:1df0b61d3b5a | 2 | #define _COMMANDQUEUE_H_ |
Michael J. Spencer |
2:1df0b61d3b5a | 3 | |
Michael J. Spencer |
2:1df0b61d3b5a | 4 | #ifdef __cplusplus |
Michael J. Spencer |
2:1df0b61d3b5a | 5 | |
Michael J. Spencer |
2:1df0b61d3b5a | 6 | #include "fifo.h" |
Michael J. Spencer |
2:1df0b61d3b5a | 7 | #include <string> |
Michael J. Spencer |
2:1df0b61d3b5a | 8 | |
Michael J. Spencer |
2:1df0b61d3b5a | 9 | #include "StreamOutput.h" |
Michael J. Spencer |
2:1df0b61d3b5a | 10 | |
Michael J. Spencer |
2:1df0b61d3b5a | 11 | class CommandQueue |
Michael J. Spencer |
2:1df0b61d3b5a | 12 | { |
Michael J. Spencer |
2:1df0b61d3b5a | 13 | public: |
Michael J. Spencer |
2:1df0b61d3b5a | 14 | CommandQueue(); |
Michael J. Spencer |
2:1df0b61d3b5a | 15 | ~CommandQueue(); |
Michael J. Spencer |
2:1df0b61d3b5a | 16 | bool pop(); |
Michael J. Spencer |
2:1df0b61d3b5a | 17 | int add(const char* cmd, StreamOutput *pstream); |
Michael J. Spencer |
2:1df0b61d3b5a | 18 | int size() {return q.size();} |
Michael J. Spencer |
2:1df0b61d3b5a | 19 | static CommandQueue* getInstance(); |
Michael J. Spencer |
2:1df0b61d3b5a | 20 | |
Michael J. Spencer |
2:1df0b61d3b5a | 21 | private: |
Michael J. Spencer |
2:1df0b61d3b5a | 22 | typedef struct {char* str; StreamOutput *pstream; } cmd_t; |
Michael J. Spencer |
2:1df0b61d3b5a | 23 | Fifo<cmd_t> q; |
Michael J. Spencer |
2:1df0b61d3b5a | 24 | static CommandQueue *instance; |
Michael J. Spencer |
2:1df0b61d3b5a | 25 | StreamOutput *null_stream; |
Michael J. Spencer |
2:1df0b61d3b5a | 26 | }; |
Michael J. Spencer |
2:1df0b61d3b5a | 27 | |
Michael J. Spencer |
2:1df0b61d3b5a | 28 | #else |
Michael J. Spencer |
2:1df0b61d3b5a | 29 | |
Michael J. Spencer |
2:1df0b61d3b5a | 30 | extern int network_add_command(const char * cmd, void *pstream); |
Michael J. Spencer |
2:1df0b61d3b5a | 31 | #endif |
Michael J. Spencer |
2:1df0b61d3b5a | 32 | |
Michael J. Spencer |
2:1df0b61d3b5a | 33 | #endif |