tablestream.hxx

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/tablestream.hxx
00005  *
00006  *   DESCRIPTION
00007  *      definition of the pqxx::tablestream class.
00008  *   pqxx::tablestream provides optimized batch access to a database table
00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/tablestream instead.
00010  *
00011  * Copyright (c) 2001-2006, Jeroen T. Vermeulen <jtv@xs4all.nl>
00012  *
00013  * See COPYING for copyright license.  If you did not receive a file called
00014  * COPYING with this source code, please notify the distributor of this mistake,
00015  * or contact the author.
00016  *
00017  *-------------------------------------------------------------------------
00018  */
00019 #include "pqxx/compiler-public.hxx"
00020 #include "pqxx/compiler-internal-pre.hxx"
00021 
00022 #include "pqxx/transaction_base"
00023 
00024 /* Methods tested in eg. self-test program test001 are marked with "//[t1]"
00025  */
00026 
00027 
00028 namespace pqxx
00029 {
00030 class transaction_base;
00031 
00032 
00034 
00043 class PQXX_LIBEXPORT tablestream : public internal::transactionfocus
00044 {
00045 public:
00046   explicit tablestream(transaction_base &Trans,
00047               const PGSTD::string &Null=PGSTD::string());               //[t6]
00048 
00049   virtual ~tablestream() throw () =0;                                   //[t6]
00050 
00052 
00059   virtual void complete() =0;
00060 
00061 protected:
00062   const PGSTD::string &NullStr() const { return m_Null; }
00063   bool is_finished() const throw () { return m_Finished; }
00064   void base_close();
00065 
00067   template<typename ITER>
00068   static PGSTD::string columnlist(ITER colbegin, ITER colend);
00069 
00070 private:
00071   PGSTD::string m_Null;
00072   bool m_Finished;
00073 
00074   // Not allowed:
00075   tablestream();
00076   tablestream(const tablestream &);
00077   tablestream &operator=(const tablestream &);
00078 };
00079 
00080 
00081 template<typename ITER> inline
00082 PGSTD::string tablestream::columnlist(ITER colbegin, ITER colend)
00083 {
00084   return separated_list(",", colbegin, colend);
00085 }
00086 } // namespace pqxx
00087 
00088 #include "pqxx/compiler-internal-post.hxx"

Generated on Thu Feb 1 17:12:08 2007 for libpqxx by  doxygen 1.5.1