21 #include "pqxx/compiler-public.hxx"
30 #ifdef PQXX_TR1_HEADERS
36 #include "pqxx/strconv"
272 #include <pqxx/libpq-forward.hxx>
358 template<typename T=PGSTD::
string, typename CONT=PGSTD::vector<T> >
365 explicit items(
const T &t) : CONT() { this->push_back(t); }
366 items(
const T &t1,
const T &t2) : CONT()
367 { this->push_back(t1); this->push_back(t2); }
368 items(
const T &t1,
const T &t2,
const T &t3) : CONT()
369 { this->push_back(t1); this->push_back(t2); this->push_back(t3); }
370 items(
const T &t1,
const T &t2,
const T &t3,
const T &t4) : CONT()
377 items(
const T&t1,
const T&t2,
const T&t3,
const T&t4,
const T&t5):CONT()
403 typename ITER::value_type
operator()(ITER i)
const {
return *i; }
416 template<
typename ITER,
typename ACCESS>
inline
426 for (++begin; begin != end; ++begin)
441 template<
typename ITER>
inline PGSTD::string
447 template<
typename OBJ>
inline PGSTD::string
453 template<
typename CONTAINER>
inline PGSTD::string
477 void PQXX_LIBEXPORT
freepqmem(
const void *);
484 #ifdef PQXX_HAVE_SHARED_PTR
487 template<
typename T,
void (*DELETER)(T *) = freepqmem_templated<T> >
488 class PQAlloc :
protected PQXXTR1::shared_ptr<T>
490 typedef PQXXTR1::shared_ptr<T> super;
494 explicit PQAlloc(T *t) : super(t, DELETER) {}
497 using super::operator=;
498 using super::operator->;
499 using super::operator*;
504 #else // !PQXX_HAVE_SHARED_PTR
510 refcount *
volatile m_l, *
volatile m_r;
520 bool loseref()
throw ();
545 template<
typename T,
void (*DELETER)(T *) = freepqmem_templated<T> >
562 explicit PQAlloc(T *obj)
throw () : m_Obj(obj), m_rc() {}
574 operator bool()
const throw () {
return m_Obj != 0; }
584 if (!m_Obj)
throw PGSTD::logic_error(
"Null pointer dereferenced");
596 T *
get()
const throw () {
return m_Obj; }
598 void reset() throw () { loseref(); }
601 void makeref(T *p)
throw () { m_Obj = p; }
603 void makeref(
const PQAlloc &rhs)
throw ()
610 void loseref() throw ()
612 if (m_rc.
loseref() && m_Obj) DELETER(m_Obj);
616 void redoref(
const PQAlloc &rhs)
throw ()
617 {
if (rhs.m_Obj != m_Obj) { loseref(); makeref(rhs); } }
618 void redoref(T *obj)
throw ()
619 {
if (obj != m_Obj) { loseref(); makeref(obj); } }
622 #endif // PQXX_HAVE_SHARED_PTR
637 T *
get()
const throw () {
return m_ptr; }
639 template<
typename INDEX> T &
operator[](INDEX i)
const throw ()
662 namedclass(
const PGSTD::string &Classname,
const PGSTD::string &Name=
"") :
663 m_Classname(Classname),
668 const PGSTD::string &
name()
const throw () {
return m_Name; }
669 const PGSTD::string &
classname()
const throw () {
return m_Classname;}
670 PGSTD::string description()
const;
673 PGSTD::string m_Classname, m_Name;
685 template<
typename GUEST>
691 GUEST *
get()
const throw () {
return m_Guest; }