C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::actor_ostream Class Reference

Provides support for thread-safe output operations on character streams. More...

#include <actor_ostream.hpp>

Public Types

using fun_type = actor_ostream& (*) (actor_ostream&)
 

Public Member Functions

 actor_ostream (actor_ostream &&)=default
 
 actor_ostream (const actor_ostream &)=default
 
actor_ostreamoperator= (actor_ostream &&)=default
 
actor_ostreamoperator= (const actor_ostream &)=default
 
 actor_ostream (local_actor *self)
 
 actor_ostream (scoped_actor &self)
 
template<class... Sigs>
 actor_ostream (const typed_actor_pointer< Sigs... > &ptr)
 
template<class... Args>
actor_ostreamprintln (std::string_view fmt, Args &&... args)
 Adds a new line to the actor output stream.
 
actor_ostreamwrite (std::string arg)
 Writes arg to the buffer allocated for the calling actor.
 
actor_ostreamflush ()
 Flushes the buffer allocated for the calling actor.
 
actor_ostreamoperator<< (const char *arg)
 Writes arg to the buffer allocated for the calling actor.
 
actor_ostreamoperator<< (std::string arg)
 Writes arg to the buffer allocated for the calling actor.
 
template<class T >
actor_ostreamoperator<< (const T &arg)
 Writes to_string(arg) to the buffer allocated for the calling actor, calling either std::to_string or caf::to_string depending on the argument.
 
actor_ostreamoperator<< (actor_ostream::fun_type f)
 Apply f to *this.
 

Static Public Member Functions

static void redirect (abstract_actor *self, std::string fn, int flags=0)
 Redirects all further output from self to file_name.
 
static void redirect_all (actor_system &sys, std::string fn, int flags=0)
 Redirects all further output from any actor that did not redirect its output to fname.
 

Static Public Attributes

static constexpr int append = 0x01
 Open redirection file in append mode.
 

Detailed Description

Provides support for thread-safe output operations on character streams.

The stream operates on a per-actor basis and will print only complete lines or when explicitly forced to flush its buffer. The stream will convert any operation to a message received by a printer actor. This actor is a sequence point that ensures output appears never interleaved.


The documentation for this class was generated from the following files: