rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
rotor::message_stringifier_t Struct Referenceabstract

Abstract interface for making textual/string representation of a message. More...

#include <message_stringifier.h>

Inheritance diagram for rotor::message_stringifier_t:
rotor::misc::default_stringifier_t

Public Member Functions

virtual std::string stringify (const message_base_t &) const
 returns string representation of a message
 
virtual void stringify_to (std::ostream &, const message_base_t &) const =0
 dumps string representation of a message to output stream
 

Detailed Description

Abstract interface for making textual/string representation of a message.

As the concrete/final message type might not be known at compile time the message stringifier tries to do it's best by guessing final message type. (In other words, because the double dispatch visitor pattern is not available).

That means that the message stringifier potentially has LOW PERFORMANCE and should NOT be used, for example, for logging every message at least in production code.

Member Function Documentation

◆ stringify_to()

virtual void rotor::message_stringifier_t::stringify_to ( std::ostream &  ,
const message_base_t  
) const
pure virtual

dumps string representation of a message to output stream

Implemented in rotor::misc::default_stringifier_t.


The documentation for this struct was generated from the following file: