Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of C027_Support_New by
Diff: Pipe.h
- Revision:
- 2:b6012cd91657
- Parent:
- 0:cb2d45baaca3
- Child:
- 5:5362073f2689
diff -r f41579f4e2ed -r b6012cd91657 Pipe.h --- a/Pipe.h Mon Oct 21 19:46:34 2013 +0000 +++ b/Pipe.h Fri Oct 25 08:47:22 2013 +0000 @@ -76,7 +76,7 @@ return (r != w); } //! get the number of values avialable in the buffer - int size(void) + virtual int size(void) { int t = w - r; if (t < 0) @@ -93,7 +93,7 @@ return t; } // get values from buffer (if the buffer has less values, only the values avilable are returned) - int get(T* p, int n) + virtual int get(T* p, int n) { int f = size(); if (f < n) @@ -116,9 +116,9 @@ return n; } // the following functions are useful if you like to inspect or parse the buffer - int start() { o = r; return size(); } // reset the parsing index and return the number of available elments - T next() { T t = b[o]; o = _inc(o); return t; } // get the next element and increment - void done() { r = o; } // commit the index + virtual int start(void) { o = r; return size(); } // reset the parsing index and return the number of available elments + virtual T next(void) { T t = b[o]; o = _inc(o); return t; } // get the next element and increment + virtual void done(void) { r = o; } // commit the index private: // buffer