#include <Chain.h>
Public Member Functions | |
Chain (HeadType head, const TailType &tail) | |
Constructor. Sets the head and the tail of the new chain. | |
Chain (const Chain< HeadType, TailType > &aChain) | |
Copy constructor. Sets the head and the tail of the new chain. | |
Chain< HeadType, TailType > & | operator= (const Chain< HeadType, TailType > &aChain) |
Copy assignment operator. | |
HeadType | GetHead () const |
Returns the m_head attribute. | |
const TailType & | GetTail () const |
Returns the m_tail attribute. | |
template<typename T > | |
boost::enable_if_c < boost::is_arithmetic< T > ::value, Chain< T, Chain < HeadType, TailType > > >::type | operator+ (T head) |
Returns the new Chain with head argument as a new m_head and the original Chain as a m_tail. | |
template<typename T > | |
boost::disable_if_c < boost::is_arithmetic< T > ::value, Chain< const T &, Chain< HeadType, TailType > > >::type | operator+ (const T &head) |
Returns the new Chain with head argument as a new m_head and the original Chain as a m_tail. | |
Private Attributes | |
HeadType | m_head |
First value of the chain. | |
const TailType & | m_tail |
Rest of the chain. | |
Friends | |
class | Chain |
Serves as a container for values that user wants to display in a log message. After being wrapped in a ChainLoggable or FormattedChainLoggable it can be passed to the logging pipeline via ScopeLogger::Log().
Chain works like a list from functional programming languages - each instance contains the first value on the m_head attribute, and the rest of the chain - which can be empty - on the m_tail attribute.
HeadType | Type of the head. Can be a reference or a pointer. | |
TailType | Type of the tail. Has to be a direct type, as m_tail is always stored via reference. |
Definition at line 45 of file Chain.h.
boost::disable_if_c<boost::is_arithmetic<T>::value, Chain<const T&, Chain<HeadType, TailType> > >::type operator+ | ( | const T & | head | ) | [inline] |