libpqxx  4.0.1
tablestream.hxx
1 /*-------------------------------------------------------------------------
2  *
3  * FILE
4  * pqxx/tablestream.hxx
5  *
6  * DESCRIPTION
7  * definition of the pqxx::tablestream class.
8  * pqxx::tablestream provides optimized batch access to a database table
9  * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/tablestream instead.
10  *
11  * Copyright (c) 2001-2011, Jeroen T. Vermeulen <jtv@xs4all.nl>
12  *
13  * See COPYING for copyright license. If you did not receive a file called
14  * COPYING with this source code, please notify the distributor of this mistake,
15  * or contact the author.
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef PQXX_H_TABLESTREAM
20 #define PQXX_H_TABLESTREAM
21 #include "pqxx/compiler-public.hxx"
22 #include "pqxx/compiler-internal-pre.hxx"
23 #include "pqxx/transaction_base"
24 namespace pqxx
25 {
26 class transaction_base;
28 class PQXX_LIBEXPORT PQXX_NOVTABLE tablestream :
30 {
31 public:
32  explicit tablestream(transaction_base &Trans,
33  const PGSTD::string &Null=PGSTD::string());
34  virtual ~tablestream() throw () =0;
35  virtual void complete() =0;
36 protected:
37  const PGSTD::string &NullStr() const { return m_Null; }
38  bool is_finished() const throw () { return m_Finished; }
39  void base_close();
40  template<typename ITER>
41  static PGSTD::string columnlist(ITER colbegin, ITER colend);
42 private:
43  PGSTD::string m_Null;
44  bool m_Finished;
45  tablestream();
46  tablestream(const tablestream &);
47  tablestream &operator=(const tablestream &);
48 };
49 template<typename ITER> inline
50 PGSTD::string tablestream::columnlist(ITER colbegin, ITER colend)
51 {
52  return separated_list(",", colbegin, colend);
53 }
54 } // namespace pqxx
55 #include "pqxx/compiler-internal-post.hxx"
56 #endif