20#include <boost/move/make_unique.hpp>
27boost::thread_specific_ptr<Thread_local_string_appender::Source_obj_to_appender_map>
32Thread_local_string_appender*
74 const auto&
id = source_obj_id.
unique_id();
75 auto& appender_ptr_ref = appender_ptrs_map[id];
76 if (!appender_ptr_ref)
91 return appender_ptr_ref.get();
95 m_target_appender_ostream_prev_os_state
96 (boost::movelib::make_unique<boost::io::ios_all_saver>(m_target_appender_ostream.os()))
115 using boost::io::ios_all_saver;
Internal flow::log class that facilitates a more efficient way to get util::ostream_op_to_string() be...
void save_formatting_state_and_restore_prev()
Saves the formatting state of the ostream returned by appender_ostream() and sets that same ostream t...
static boost::thread_specific_ptr< Source_obj_to_appender_map > s_this_thread_appender_ptrs
Thread-local storage for each thread's map storing objects of this class (lazily set to non-null on 1...
const std::string & target_contents() const
Read-only accessor for the contents of the string, as written to it since the last fresh_appender_ost...
boost::unordered_map< util::Unique_id_holder::id_t, boost::movelib::unique_ptr< Thread_local_string_appender > > Source_obj_to_appender_map
Short-hand for map of a given thread's appender objects indexed by the IDs of their respective source...
static Thread_local_string_appender * get_this_thread_string_appender(const util::Unique_id_holder &source_obj_id)
Returns a pointer to the exactly one Thread_local_string_appender object that is accessible from the ...
std::ostream * appender_ostream()
Same as fresh_appender_ostream() but does not clear the result string, enabling piecemeal writing to ...
util::String_ostream m_target_appender_ostream
The target string wrapped by an ostream. Emptied at construction and in fresh_appender_ostream() only...
Thread_local_string_appender()
Initializes object with an empty string and the streams machinery available to write to that string.
boost::movelib::unique_ptr< boost::io::ios_all_saver > m_target_appender_ostream_prev_os_state
Stores the ostream formatter state from construction time or time of last save_formatting_state_and_r...
std::ostream * fresh_appender_ostream()
Clears the internally stored string (accessible for reading via target_contents()),...
void str_clear()
Performs std::string::clear() on the object returned by str().
std::ostream & os()
Access to stream that will write to owned string.
const std::string & str() const
Read-only access to the string being wrapped.
Each object of this class stores (at construction) and returns (on demand) a numeric ID unique from a...
id_t unique_id() const
Raw unique ID identifying this object as well as any object of a derived type.
Flow module providing logging functionality.