libpqxx
tablestream.hxx
1 
13 #ifndef PQXX_H_TABLESTREAM
14 #define PQXX_H_TABLESTREAM
15 
16 #include "pqxx/compiler-public.hxx"
17 #include "pqxx/compiler-internal-pre.hxx"
18 #include "pqxx/transaction_base.hxx"
19 
20 
21 namespace pqxx
22 {
24 class PQXX_LIBEXPORT PQXX_NOVTABLE tablestream :
26 {
27 public:
28  explicit tablestream(
29  transaction_base &Trans,
30  const std::string &Null=std::string());
31  virtual ~tablestream() noexcept =0;
32  virtual void complete() =0;
33 protected:
34  const std::string &NullStr() const { return m_null; }
35  bool is_finished() const noexcept { return m_finished; }
36  void base_close();
37  template<typename ITER>
38  static std::string columnlist(ITER colbegin, ITER colend);
39 private:
40  std::string m_null;
41  bool m_finished = false;
42  tablestream();
43  tablestream(const tablestream &);
44  tablestream &operator=(const tablestream &);
45 };
46 
47 
48 template<typename ITER> inline
49 std::string tablestream::columnlist(ITER colbegin, ITER colend)
50 {
51  return separated_list(",", colbegin, colend);
52 }
53 } // namespace pqxx
54 
55 #include "pqxx/compiler-internal-post.hxx"
56 #endif
const std::string & NullStr() const
Definition: tablestream.hxx:34
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:22
Definition: transaction_base.hxx:42
std::string separated_list(const std::string &sep, ITER begin, ITER end, ACCESS access)
Represent sequence of values as a separated string.
Definition: util.hxx:96
bool is_finished() const noexcept
Definition: tablestream.hxx:35
Definition: tablestream.hxx:24
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:130
static std::string columnlist(ITER colbegin, ITER colend)
Definition: tablestream.hxx:49