Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <message_callback_data.h>
Public Member Functions | |
MessageCallbackData ()=default | |
MessageCallbackData (const MessageCallbackData &)=delete | |
MessageCallbackData & | operator= (const MessageCallbackData &)=delete |
std::vector< std::string > | Parse (absl::string_view message) |
std::vector< std::string > | Flush () |
Buffer for solvers messages that enforces the contract of MessageCallback.
This contract mandates that each message is a full finished line. As a consequence, if the solver calls the callback with a partial last line, this one must not be passed immediately to MessageCallback but kept until the end of the line is reached (or the solve is done).
To implement that this class has two methods:
Definition at line 41 of file message_callback_data.h.
|
default |
|
delete |
std::vector< std::string > operations_research::math_opt::MessageCallbackData::Flush | ( | ) |
Returns a vector with the last unfinished line if it exists, else an empty vector.
Definition at line 55 of file message_callback_data.cc.
|
delete |
std::vector< std::string > operations_research::math_opt::MessageCallbackData::Parse | ( | absl::string_view | message | ) |
Parses the input message, returning a vector with all finished lines. Returns an empty vector if the input message did not contain any '
'.
It updates this object with the last unfinished line to use it to complete the next message.
Iterate on all complete lines (lines ending with a '
').
At the end of the loop, the remainder may contain the last unfinished line. This could be the first line too if the entire message does not contain '
'.
Definition at line 28 of file message_callback_data.cc.