souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
24 #include <type_traits>
46 namespace stream_write_qualified_char_as_number {
47 inline std::ostream&
operator<<(std::ostream& os,
signed char c) {
51 inline std::ostream&
operator<<(std::ostream& os,
unsigned char c) {
52 return os << unsigned(c);
57 struct IsPtrLike : std::is_pointer<A> {};
61 struct IsPtrLike<
std::shared_ptr<A>> : std::true_type {};
72 template <
typename Iter,
typename Pr
inter>
73 class joined_sequence {
100 for (; cur != s.end; ++cur) {
113 template <
typename Extractor>
115 template <
typename T>
116 void operator()(std::ostream& out,
const T& value)
const {
129 template <
typename T>
144 template <
typename T>
149 auto operator()(
const T& t)
const -> decltype(*t) {
159 template <
typename T>
168 template <
typename Iter,
typename Pr
inter>
170 const Iter& a,
const Iter&
b,
const std::string& sep,
const Printer&
p) {
180 template <
typename Iter,
typename T =
typename Iter::value_type>
182 const Iter& a,
const Iter&
b,
const std::string& sep =
",") {
192 template <
typename Container,
typename Pr
inter,
typename Iter =
typename Container::const_iterator>
194 return join(c.begin(), c.end(), sep,
p);
199 template <
typename A>
208 template <
typename Container,
typename Iter =
typename Container::const_iterator,
209 typename T =
typename std::iterator_traits<Iter>::value_type>
211 const Container& c,
const std::string& sep =
",") {
215 template <
typename Container,
typename Iter =
typename Container::const_iterator,
216 typename T =
typename std::iterator_traits<Iter>::value_type>
218 const Container& c,
const std::string& sep =
",") {
224 #ifndef __EMBEDDED_SOUFFLE__
232 template <
typename T,
size_t E>
240 template <
typename A,
typename B>
242 return out <<
"(" <<
p.first <<
"," <<
p.second <<
")";
249 template <
typename T,
typename A>
258 template <
typename T,
size_t E>
267 template <
typename K,
typename C,
typename A>
276 template <
typename K,
typename C,
typename A>
277 ostream&
operator<<(ostream& out,
const multiset<K, C, A>& s) {
285 template <
typename K,
typename T,
typename C,
typename A>
287 return out <<
"{" <<
souffle::join(
m,
",", [](ostream& out,
const pair<K, T>& cur) {
288 out << cur.first <<
"->" << cur.second;
303 template <
typename T>
310 for (
unsigned i = 0;
i < printer.
times;
i++) {
311 out << printer.
value;
321 template <
typename T>
auto operator()(T &t) const -> decltype(*t)
Iter begin
The begin of the range to be printed.
A utility class required for the implementation of the times function.
A generic element printer.
A functor representing the identity function for a generic type T.
Printer p
A functor printing an element.
std::string sep
The seperator to be utilized between elements.
A functor printing elements after dereferencing it.
constexpr bool JoinShouldDeref
multiplying_printer(const T &value, unsigned times)
detail::multiplying_printer< T > times(const T &value, unsigned num)
A utility printing a given value multiple times.
joined_sequence(const Iter &a, const Iter &b, std::string sep, Printer p)
A constructor setting up all fields of this class.
A auxiliary class to be returned by the join function aggregating the information required to print a...
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
void operator()(std::ostream &out, const T &value) const
Iter end
The end of the range to be printed.
l j a showGridBackground &&c b raw series this eventEmitter b
ostream & operator<<(ostream &out, const array< T, E > &v)
Enables the generic printing of arrays assuming their element types are printable.
std::ostream & operator<<(std::ostream &os, signed char c)
friend std::ostream & operator<<(std::ostream &out, const joined_sequence &s)
The actual print method.
friend std::ostream & operator<<(std::ostream &out, const multiplying_printer &printer)
A functor dereferencing a given type.
a horizontalBars(j=m=void 0===a.axisX.type?new c.AutoScaleAxis(c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX,{highLow:d, referenceValue:0})):a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX,{highLow:d, referenceValue:0})), l=n=void 0===a.axisY.type?new c.StepAxis(c.Axis.units.y, b.normalized.series, o,{ticks:k}):a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, o, a.axisY)) var p
T & operator()(T &t) const