boost::logging::optimize::cache_string_several_str< string_type_, ptr_type > Struct Template Reference

This holds 3 strings - one for prepend, one for modification, and one for appending. More...

List of all members.

Public Member Functions

 cache_string_several_str (int reserve_=512)
 cache_string_several_str (const string_type &msg, int reserve_=512)
void set_string_swap (string_type &msg)
void set_string (const string_type &msg)
 sets the string
void prepend_string (const string_type &str)
 pre-pends a string (inserts it at the beginning)
void append_string (const string_type &str)
 appends a string (inserts it at the end)
void set_last_id (ptr_type id)
void reuse (ptr_type id)
 Reuses a pre-pended or appended string. The message was already cached.
const string_type & full_string () const
 computes (if necessary) and returns the full string
 operator const string_type & () const
 computes (if necessary) and returns the full string
void restart ()
 This restarts writing the messages. Whatever is cached can be used again.


Detailed Description

template<class string_type_ = boost::logging::hold_string_type, class ptr_type = void*>
struct boost::logging::optimize::cache_string_several_str< string_type_, ptr_type >

This holds 3 strings - one for prepend, one for modification, and one for appending.

When you prepend or append, you can also specify an extra argument - an identifier. This identifier uniquely identifies the prepended or appended message.

Afterwards, you can prepend/append only by specifying an identifier - which will identify a previously appended or prepended message


Constructor & Destructor Documentation

template<class string_type_ = boost::logging::hold_string_type, class ptr_type = void*>
boost::logging::optimize::cache_string_several_str< string_type_, ptr_type >::cache_string_several_str ( int  reserve_ = 512  )  [inline]

constructs an object

Parameters:
reserve_ [optional, default = 512] When creating the full msg, how much should we reserve?

template<class string_type_ = boost::logging::hold_string_type, class ptr_type = void*>
boost::logging::optimize::cache_string_several_str< string_type_, ptr_type >::cache_string_several_str ( const string_type &  msg,
int  reserve_ = 512 
) [inline]

constructs an object

Parameters:
reserve_ [optional, default = 512] When creating the full msg, how much should we reserve?


Member Function Documentation

template<class string_type_ = boost::logging::hold_string_type, class ptr_type = void*>
void boost::logging::optimize::cache_string_several_str< string_type_, ptr_type >::set_string_swap ( string_type &  msg  )  [inline]

sets the string with a swap (that is, you pass a non-const refererence, and we do a swap)

template<class string_type_ = boost::logging::hold_string_type, class ptr_type = void*>
void boost::logging::optimize::cache_string_several_str< string_type_, ptr_type >::set_last_id ( ptr_type  id  )  [inline]

Specifies the id of the last message


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

Copyright John Torjo © 2007
Have a question/ suggestion/ comment? Send me feedback