#include <console_handler.h>
Definition at line 50 of file console_handler.h.
◆ async_stdin_reader()
| epee::async_stdin_reader::async_stdin_reader |
( |
| ) |
|
|
inline |
Definition at line 53 of file console_handler.h.
54 : m_run(true)
55 , m_has_read_request(false)
56 , m_read_status(state_init)
57 {
58#ifdef HAVE_READLINE
59 m_readline_buffer.start();
60#endif
61 m_reader_thread = boost::thread(std::bind(&async_stdin_reader::reader_thread_func, this));
62 }
◆ ~async_stdin_reader()
| epee::async_stdin_reader::~async_stdin_reader |
( |
| ) |
|
|
inline |
◆ eos()
| bool epee::async_stdin_reader::eos |
( |
| ) |
const |
|
inline |
◆ get_line()
| bool epee::async_stdin_reader::get_line |
( |
std::string & | line | ) |
|
|
inline |
Definition at line 78 of file console_handler.h.
79 {
80 if (!start_read())
81 return false;
82
83 if (state_eos == m_read_status)
84 return false;
85
86 boost::unique_lock<boost::mutex> lock(m_response_mutex);
87 while (state_init == m_read_status)
88 {
89 m_response_cv.wait(lock);
90 }
91
93 if (state_success == m_read_status)
94 {
95 line = m_line;
97 }
98
100 m_read_status = state_init;
101
103 }
◆ stop()
| void epee::async_stdin_reader::stop |
( |
| ) |
|
|
inline |
Definition at line 107 of file console_handler.h.
108 {
109 if (m_run)
110 {
111 m_run.store(false, std::memory_order_relaxed);
112
113#if defined(WIN32)
114 ::CloseHandle(::GetStdHandle(STD_INPUT_HANDLE));
115#endif
116
117 m_request_cv.notify_one();
118 m_reader_thread.join();
119#ifdef HAVE_READLINE
120 m_readline_buffer.stop();
121#endif
122 }
123 }
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/contrib/epee/include/console_handler.h