Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

templog::formating_policy_base< FormattingPolicy_ > Class Template Reference

#include <logging.h>

List of all members.

Static Public Member Functions

template<class WritePolicy_, int Sev_, int Aud_, class ParamList_>
static void write_msg (TEMPLOG_SOURCE_SIGN, const ParamList_ &parameters)

Static Protected Member Functions

template<class WritePolicy_, class WriteToken_, typename T>
static void write_obj (WriteToken_ &token, const T &obj)
template<class WritePolicy_, class WriteToken_, class Param_, class ParamList_>
static void write_params (WriteToken_ &token, const templ_meta::tuple< const Param_ *, ParamList_ > &parameters)


Detailed Description

template<typename FormattingPolicy_>
class templog::formating_policy_base< FormattingPolicy_ >

formatting policy base class

Formatting policies describe how log messages are to be written. In order to achieve maximum performance (by exploring compile-time decisions and heavily inlined code) formatting policies have to tightly work together with write policies.

There already are a few pre-defined formatting policies. If you want to write your own, this class provides all the boiler-plate for writing arbitrary objects as well as all of the log statement's parameters in collaboration with the write policy.

If you want to use this code, derive from this class, passing the derived class' type as a template parameter. In your derived class implement a function with this template< class WritePolicy_, int Sev_, int Aud_, class WriteToken_, class ParamList_ > static void write(WriteToken_& token, TEMPLOG_SOURCE_SIGN, const ParamList_& parameters); signature which uses the base class' write_obj() and write_params() functions in order to write a formatted log message to an arbitrary sink.

See also:
write_policy_base

sev_aud_formating_policy

visual_studio_formating_policy

Definition at line 411 of file logging.h.


Member Function Documentation

template<typename FormattingPolicy_>
template<class WritePolicy_, int Sev_, int Aud_, class ParamList_>
static void templog::formating_policy_base< FormattingPolicy_ >::write_msg TEMPLOG_SOURCE_SIGN  ,
const ParamList_ &  parameters
[inline, static]
 

Writes a log message using the derived class' write() function.

Definition at line 417 of file logging.h.

template<typename FormattingPolicy_>
template<class WritePolicy_, class WriteToken_, typename T>
static void templog::formating_policy_base< FormattingPolicy_ >::write_obj WriteToken_ &  token,
const T &  obj
[inline, static, protected]
 

Calls this from derived classes in order to write arbitrary objects.

Note:
Objects must have a output stream operator overloaded.

Definition at line 430 of file logging.h.

template<typename FormattingPolicy_>
template<class WritePolicy_, class WriteToken_, class Param_, class ParamList_>
static void templog::formating_policy_base< FormattingPolicy_ >::write_params WriteToken_ &  token,
const templ_meta::tuple< const Param_ *, ParamList_ > &  parameters
[inline, static, protected]
 

Call this from derived classes in order to write a parameter list.

Definition at line 437 of file logging.h.


The documentation for this class was generated from the following file:
Generated on Sun Jan 11 15:57:20 2009 for templog library by  doxygen 1.4.2