More work on client and server
This commit is contained in:
@@ -71,9 +71,11 @@
|
||||
|
||||
#include "streambuffer.hpp"
|
||||
#include "util.hpp"
|
||||
#include "invocation.hpp"
|
||||
#include <deque>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
|
||||
class PrintBuffer {
|
||||
private:
|
||||
@@ -136,5 +138,25 @@ public:
|
||||
|
||||
using UniquePrintBuffer = std::unique_ptr<PrintBuffer>;
|
||||
|
||||
class PrintChanneler {
|
||||
private:
|
||||
int64_t line_;
|
||||
public:
|
||||
PrintChanneler() { line_ = 0; }
|
||||
|
||||
// Reset the print channeler.
|
||||
void reset() { line_ = 0; }
|
||||
|
||||
// Copy any new lines from the printbuffer to the stdostream.
|
||||
// Update the current line number. Return true if the printbuffer
|
||||
// contains any lines that have already been channeled.
|
||||
bool channel(const PrintBuffer *pb, std::ostream &ostream);
|
||||
|
||||
// Generate an invocation that removes unnecessary lines from the
|
||||
// printbuffer.
|
||||
Invocation invocation(int64_t actor_id);
|
||||
};
|
||||
|
||||
|
||||
#endif // PRINTBUFFER_HPP
|
||||
|
||||
|
||||
Reference in New Issue
Block a user