26 template<
typename GetHeader,
typename GetData>
31 TableImpl(
const std::string &
name, GetHeader get_header_fn, GetData get_data_fn)
32 :
Element(
name), get_header_fn_(get_header_fn), get_data_fn_(get_data_fn)
41 builder.
write(get_header_fn_());
42 builder.
write(get_data_fn_());
46 GetHeader get_header_fn_;
61 template<
typename GetHeader,
typename GetFormat,
typename GetData>
65 :
TableImpl<GetHeader, GetData>(
name, get_header_fn, get_data_fn), get_format_fn_(get_format_fn)
74 builder.
write(get_format_fn_());
78 GetFormat get_format_fn_;
90 template<
typename GetData>
96 std::vector<std::string> header,
97 std::vector<std::string> format,
99 :
Element(
name), header_(
std::move(header)), format_(
std::move(format)), get_data_fn_(get_data_fn)
108 builder.
write(header_);
109 builder.
write(get_data_fn_());
110 builder.
write(format_);
114 std::vector<std::string> header_;
115 std::vector<std::string> format_;
116 GetData get_data_fn_;
122 template<
typename GetData>
123 auto Table(
const std::string & name, std::vector<std::string> header, GetData get_data_fn)
125 return details::StaticTableImpl(name, std::move(header), std::vector<std::string>(header.size(),
"{}"), get_data_fn);
129 template<
typename GetData>
130 auto Table(
const std::string & name,
131 std::vector<std::string> header,
132 std::vector<std::string> format,
135 while(format.size() < header.size()) { format.push_back(
"{}"); }
140 template<
typename GetHeader,
typename GetData>
141 auto Table(
const std::string & name, GetHeader get_header_fn, GetData get_data_fn)
147 template<
typename GetHeader,
typename GetFormat,
typename GetData>
148 auto Table(
const std::string & name, GetHeader get_header_fn, GetFormat get_format_fn, GetData get_data_fn)