Shohei Yasutake / Mbed 2 deprecated koibumi2000

Dependencies:   fll mbed-rtos mbed

Revision:
6:d0348b7a2f05
Parent:
5:130721ce29f7
Child:
7:61b4825304e2
Child:
29:2f3d6d09eaac
diff -r 130721ce29f7 -r d0348b7a2f05 fll.h
--- a/fll.h	Sat Feb 14 07:25:27 2015 +0000
+++ b/fll.h	Sat Feb 14 08:02:21 2015 +0000
@@ -26,25 +26,30 @@
 
 typedef uint16_t button_t;
 
-class Source
-{
+// Base object for stream network
+class Producer {
+public:
+    virtual button_t await() = 0;
+};
+
+// 0 input
+class RepeaterSource : public Producer {
 private:
     int i;
-    button_t* button_t_seq;
+    button_t* button_seq;
     int size;
-    bool loop;
 public:
-    Source(button_t *bs, int s, bool l);
+    RepeaterSource(button_t *bs, int s);
     virtual button_t await();
 };
 
-class Pipe : public Source
-{
+// N inputs
+class FoldFlow : public Producer {
 private:
-    Source** sources;
+    Producer** sources;
     int sources_size;
 public:
-    Pipe(Source **srcs, int srcs_size);
+    FoldFlow(Producer **srcs, int srcs_size);
     virtual button_t fold(button_t *bs, int bs_size) = 0;
     virtual button_t await();
 };
@@ -53,13 +58,13 @@
 class Sink
 {
 private:
-    Source* source;
+    Producer* source;
     rtos::Mail<button_t, MAIL_BOX_SIZE>* mail_box;
     Mutex* mutex;
 public:
-    Sink(Source* src, rtos::Mail<button_t, MAIL_BOX_SIZE>* box, Mutex* mut);
+    Sink(Producer* src, rtos::Mail<button_t, MAIL_BOX_SIZE>* box, Mutex* mut);
     void run();
-    void reset(Source* src);
+    void reset(Producer* src);
 };