#include <parser_token_buffer.hpp>
Public Member Functions | |
parser_token_buffer (size_t min_token_size, size_t max_token_size) | |
void | check_and_notify (tokens_type &parser_tokens) |
void | notify_and_finish (tokens_type &parser_tokens) |
bool | next_tokens (tokens_type &tokens) |
size_t | token_size_threshold () const |
Class that manages synchronization of parser tokens used in multi-threaded parsers.
|
inline |
Check the size of the parser token buffer, and if it exceeds specified threshold, move it to the client buffer.
Call this from the parser thread.
parser_tokens | parser token buffer. |
|
inline |
Retrieve the tokens currently in the client token buffer.
Call this from the client (non-parser) thread.
tokens | place to move the tokens in the client token buffer to. |
|
inline |
Move the current parser token buffer to the client buffer, and signal the end of parsing.
Call this from the parser thread.
parser_tokens | parser token buffer. |
|
inline |
Return the current token size threshold. Call this only after the parsing has finished.