|
R-Type
Networked shoot'em up built on Aegis2D
|
The lines typed on a stream, read on a thread of their own, for the network thread to take between two updates. More...
#include </__w/project-rtype/project-rtype/server/include/rtype/admin_console.hpp>
Public Member Functions | |
| ConsoleInput (std::istream &input) | |
| Starts reading. | |
| std::vector< std::string > | take () |
| The lines read since the last call. | |
| bool | ended () const |
| Tells whether the stream ended. | |
The lines typed on a stream, read on a thread of their own, for the network thread to take between two updates.
Reading blocks until a line comes, so the thread is detached and only touches the lines it shares with this object: the process may end while it waits. It ends at the end of the stream (Ctrl+D, Ctrl+Z, or a closed pipe).
|
explicit |
Starts reading.
| input | Stream to read, such as std::cin; it must outlive the reading. |
| bool rtype::ConsoleInput::ended | ( | ) | const |
Tells whether the stream ended.
true once every line was read. Thread-safe. | std::vector< std::string > rtype::ConsoleInput::take | ( | ) |
The lines read since the last call.