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 
26 class PQXX_LIBEXPORT PQXX_NOVTABLE tablestream :
28 {
29 public:
30  explicit tablestream(
31  transaction_base &Trans,
32  const std::string &Null=std::string{});
33  virtual ~tablestream() noexcept =0;
34  virtual void complete() =0;
35 protected:
36  const std::string &NullStr() const { return m_null; }
37  bool is_finished() const noexcept { return m_finished; }
38  void base_close();
39  template<typename ITER>
40  static std::string columnlist(ITER colbegin, ITER colend);
41 private:
42  std::string m_null;
43  bool m_finished = false;
44 
45  tablestream() =delete;
46  tablestream(const tablestream &) =delete;
47  tablestream &operator=(const tablestream &) =delete;
48 };
49 
50 
51 template<typename ITER> inline
52 std::string tablestream::columnlist(ITER colbegin, ITER colend)
53 {
54  return separated_list(",", colbegin, colend);
55 }
56 } // namespace pqxx
57 
58 #include "pqxx/compiler-internal-post.hxx"
59 #endif
Definition: transaction_base.hxx:43
const std::string & NullStr() const
Definition: tablestream.hxx:36
Base class for obsolete tablereader/tablewriter classes.
Definition: tablestream.hxx:26
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:136
bool is_finished() const noexcept
Definition: tablestream.hxx:37
static std::string columnlist(ITER colbegin, ITER colend)
Definition: tablestream.hxx:52
std::string separated_list(const std::string &sep, ITER begin, ITER end, ACCESS access)
Represent sequence of values as a string, joined by a given separator.
Definition: util.hxx:95
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25