stream_base.hxx
#ifndef PQXX_H_STREAM_BASE
#define PQXX_H_STREAM_BASE
#include "pqxx/compiler-public.hxx"
#include "pqxx/compiler-internal-pre.hxx"
#include "pqxx/transaction_base.hxx"
#include "pqxx/util.hxx"
#include <string>
namespace pqxx
{
class PQXX_LIBEXPORT PQXX_NOVTABLE stream_base :
public internal::transactionfocus
{
public:
explicit stream_base(transaction_base &);
// TODO: Can we get rid of the vtable?
virtual ~stream_base() noexcept =default;
virtual void complete() = 0;
operator bool() const noexcept;
bool operator!() const noexcept;
protected:
bool m_finished;
virtual void close();
template<typename C> static std::string columnlist(const C &);
template<typename I> static std::string columnlist(I begin, I end);
private:
stream_base();
stream_base(const stream_base&);
stream_base & operator=(const stream_base &);
};
template<typename C> std::string stream_base::columnlist(const C &c)
{
return columnlist(std::begin(c), std::end(c));
}
template<typename I> std::string stream_base::columnlist(I begin, I end)
{
return separated_list(",", begin, end);
}
} // namespace pqxx
#include "pqxx/compiler-internal-post.hxx"
#endif
pqxx::stream_base::operator!
bool operator!() const noexcept
Definition: stream_base.cxx:30
pqxx::stream_base::m_finished
bool m_finished
Definition: stream_base.hxx:38
pqxx::stream_base::close
virtual void close()
Definition: stream_base.cxx:36
pqxx::stream_base::stream_base
stream_base(transaction_base &)
Definition: stream_base.cxx:17
pqxx::separated_list
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
pqxx::stream_base::columnlist
static std::string columnlist(const C &)
Definition: stream_base.hxx:48
pqxx::internal::transactionfocus
Definition: transaction_base.hxx:43
pqxx::transaction_base
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:136
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25
pqxx::stream_base
Definition: stream_base.hxx:27