libpniio
Public Member Functions | Private Types | Private Attributes
pni::io::container_formatter< CTYPE > Class Template Reference

formatter for containers More...

#include <formatter.hpp>

Collaboration diagram for pni::io::container_formatter< CTYPE >:
Collaboration graph
[legend]

Public Member Functions

 container_formatter (const container_io_config &config=container_io_config())
 
pni::core::string operator() (const container_type &v) const
 generate output More...
 

Private Types

typedef CTYPE container_type
 
typedef
std::back_insert_iterator
< pni::core::string > 
iterator_type
 output iterator type More...
 
typedef container_type::value_type value_type
 element type of the container More...
 
typedef get_generator
< iterator_type, value_type
getter_type
 generator type More...
 
typedef getter_type::type generator_type
 

Private Attributes

generator_type generator
 generator instance More...
 
container_io_config _config
 

Detailed Description

template<typename CTYPE>
class pni::io::container_formatter< CTYPE >

Most of the container formatters are using this code. Do not instantiate this template class by yourself. This will be done by the specializations of the formatter template for the various container types.

Template Parameters
CTYPEcontainer type

Member Typedef Documentation

template<typename CTYPE>
typedef CTYPE pni::io::container_formatter< CTYPE >::container_type
private
template<typename CTYPE>
typedef getter_type::type pni::io::container_formatter< CTYPE >::generator_type
private
template<typename CTYPE>
typedef get_generator<iterator_type,value_type> pni::io::container_formatter< CTYPE >::getter_type
private
template<typename CTYPE>
typedef std::back_insert_iterator<pni::core::string> pni::io::container_formatter< CTYPE >::iterator_type
private
template<typename CTYPE>
typedef container_type::value_type pni::io::container_formatter< CTYPE >::value_type
private

Constructor & Destructor Documentation

template<typename CTYPE>
pni::io::container_formatter< CTYPE >::container_formatter ( const container_io_config config = container_io_config())
inline

Member Function Documentation

template<typename CTYPE>
pni::core::string pni::io::container_formatter< CTYPE >::operator() ( const container_type v) const
inline

Take the input vector and return its string representation.

Parameters
vinput container
configoutput configuration for the container
Returns
string representation of the input vector

Field Documentation

template<typename CTYPE>
container_io_config pni::io::container_formatter< CTYPE >::_config
private
template<typename CTYPE>
generator_type pni::io::container_formatter< CTYPE >::generator
private

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