souffle  2.0.2-371-g6315b36
Public Member Functions | Private Attributes | Friends
souffle::detail::joined_sequence< Iter, Printer > Class Template Reference

A auxiliary class to be returned by the join function aggregating the information required to print a list of elements as well as the implementation of the printing itself. More...

#include <StreamUtil.h>

Collaboration diagram for souffle::detail::joined_sequence< Iter, Printer >:
Collaboration graph

Public Member Functions

 joined_sequence (const Iter &a, const Iter &b, std::string sep, Printer p)
 A constructor setting up all fields of this class. More...
 

Private Attributes

Iter begin
 The begin of the range to be printed. More...
 
Iter end
 The end of the range to be printed. More...
 
Printer p
 A functor printing an element. More...
 
std::string sep
 The seperator to be utilized between elements. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const joined_sequence &s)
 The actual print method. More...
 

Detailed Description

template<typename Iter, typename Printer>
class souffle::detail::joined_sequence< Iter, Printer >

A auxiliary class to be returned by the join function aggregating the information required to print a list of elements as well as the implementation of the printing itself.

Definition at line 79 of file StreamUtil.h.

Constructor & Destructor Documentation

◆ joined_sequence()

template<typename Iter , typename Printer >
souffle::detail::joined_sequence< Iter, Printer >::joined_sequence ( const Iter &  a,
const Iter &  b,
std::string  sep,
Printer  p 
)
inline

A constructor setting up all fields of this class.

Definition at line 94 of file StreamUtil.h.

94  {
95  return out;

Friends And Related Function Documentation

◆ operator<<

template<typename Iter , typename Printer >
std::ostream& operator<< ( std::ostream &  out,
const joined_sequence< Iter, Printer > &  s 
)
friend

The actual print method.

Definition at line 98 of file StreamUtil.h.

100  {
101  out << s.sep;
102  s.p(out, *cur);
103  }
104  return out;
105  }
106 };
107 
108 /**
109  * A generic element printer.
110  *
111  * @tparam Extractor a functor preparing a given value before being printed.

Field Documentation

◆ begin

template<typename Iter , typename Printer >
Iter souffle::detail::joined_sequence< Iter, Printer >::begin
private

The begin of the range to be printed.

Definition at line 81 of file StreamUtil.h.

◆ end

template<typename Iter , typename Printer >
Iter souffle::detail::joined_sequence< Iter, Printer >::end
private

The end of the range to be printed.

Definition at line 84 of file StreamUtil.h.

◆ p

template<typename Iter , typename Printer >
Printer souffle::detail::joined_sequence< Iter, Printer >::p
private

A functor printing an element.

Definition at line 90 of file StreamUtil.h.

◆ sep

template<typename Iter , typename Printer >
std::string souffle::detail::joined_sequence< Iter, Printer >::sep
private

The seperator to be utilized between elements.

Definition at line 87 of file StreamUtil.h.


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