ChainLoggable< ChainType > Class Template Reference

Wrapper which exposes the contents of the Chain object as a CompositeLoggable. More...

#include <ChainLoggable.h>

Inheritance diagram for ChainLoggable< ChainType >:

CompositeLoggable Loggable

List of all members.

Public Member Functions

 ChainLoggable (const ChainType &chain)
 Constructor.
 ChainLoggable (const ChainLoggable &chainLoggable)
 Copy constructor.
ChainLoggableoperator= (const ChainLoggable &chainLoggable)
 Copy assignment operator.
virtual void LogContentsOn (LogContentsPrinter &logContentsPrinter) const
 Passes all the elements of the m_wrappedChain to the logContentsPrinter.
virtual std::tstring GetStringValue () const
 Returns the concatenation of string representations of all the elements of the m_wrappedChain.

Protected Attributes

const ChainType & m_wrappedChain
 Reference to the wrapped chain.

Private Member Functions

template<typename HeadType , typename TailType >
void LogChainOn (const Chain< HeadType, TailType > &chain, LogContentsPrinter &logContentsPrinter) const
 Recursively passes the elements of the chain to the logContentsPrinter.
template<>
void LogChainOn (const EmptyChain &, LogContentsPrinter &) const
 Specialization of LogChainOn() for EmptyChain. Does nothing.
template<typename HeadType , typename TailType >
void AppendChainTo (const Chain< HeadType, TailType > &chain, std::tostringstream &stream) const
 Recursively outputs the elements of the chain to the stream, with space characters between them.
template<>
void AppendChainTo (const EmptyChain &, std::tostringstream &) const
 Specialization of AppendChainTo() for EmptyChain. Does nothing.

Static Private Member Functions

template<typename HeadType >
static void AppendChainElementTo (HeadType head, std::tostringstream &stream)
 Outputs a signgle chain element to the stream.
template<typename T >
static void AppendChainElementTo (std::vector< T > &head, std::tostringstream &stream)
 Outputs a signgle chain element to the stream.


Detailed Description

template<typename ChainType>
class Nvidia::Logging::ChainLoggable< ChainType >

Wrapper which exposes the contents of the Chain object as a CompositeLoggable.

Template Parameters:
ChainType Type of the wrapped Chain.

Definition at line 36 of file ChainLoggable.h.


Constructor & Destructor Documentation

ChainLoggable ( const ChainType &  chain  )  [inline]

Constructor.

Parameters:
chain Chain which should be wrapped in this ChainLoggable.

Definition at line 48 of file ChainLoggable.h.


Member Function Documentation

static void AppendChainElementTo ( std::vector< T > &  head,
std::tostringstream &  stream 
) [inline, static, private]

Outputs a signgle chain element to the stream.

Template function specialization for std::vector (necessary because we can't use LoggableTraits with templated types).

Definition at line 135 of file ChainLoggable.h.

void AppendChainTo ( const Chain< HeadType, TailType > &  chain,
std::tostringstream &  stream 
) const [inline, private]

Recursively outputs the elements of the chain to the stream, with space characters between them.

The chain is processed in reverse, i.e. from the tail to the head.

Definition at line 114 of file ChainLoggable.h.

Referenced by ChainLoggable< ChainType >::AppendChainTo(), and ChainLoggable< ChainType >::GetStringValue().

virtual std::tstring GetStringValue (  )  const [inline, virtual]

Returns the concatenation of string representations of all the elements of the m_wrappedChain.

The m_wrappedChain is processed in reverse, i.e. from the tail to the head.

Implements Loggable.

Reimplemented in FormattedChainLoggable< ChainType >.

Definition at line 79 of file ChainLoggable.h.

void LogChainOn ( const Chain< HeadType, TailType > &  chain,
LogContentsPrinter logContentsPrinter 
) const [inline, private]

Recursively passes the elements of the chain to the logContentsPrinter.

The chain is processed in reverse, i.e. from the tail to the head.

Definition at line 96 of file ChainLoggable.h.

Referenced by ChainLoggable< ChainType >::LogChainOn(), and ChainLoggable< ChainType >::LogContentsOn().

virtual void LogContentsOn ( LogContentsPrinter logContentsPrinter  )  const [inline, virtual]

Passes all the elements of the m_wrappedChain to the logContentsPrinter.

The m_wrappedChain is processed in reverse, i.e. from the tail to the head.

Implements CompositeLoggable.

Definition at line 69 of file ChainLoggable.h.


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

Generated on Thu Sep 17 15:05:17 2009 for Logging by  doxygen 1.5.8