YAPOG  0.0.1
Yet Another Pokemon Online Game
pgs::pg_stream Class Reference

#include <pgstream.hpp>

Inheritance diagram for pgs::pg_stream:
Collaboration diagram for pgs::pg_stream:

List of all members.

Public Member Functions

 pg_stream (const char *query, pg_cnx &db, int prepare_mode=2)
 constructor
 pg_stream (const std::string query, pg_cnx &db, int prepare_mode=2)
virtual ~pg_stream ()
pg_streamoperator<< (const char *)
 assign a char* parameter
pg_streamoperator<< (const std::string &)
pg_streamoperator<< (int)
 assign an int parameter
pg_streamoperator<< (unsigned int)
pg_streamoperator<< (long)
pg_streamoperator<< (unsigned long)
pg_streamoperator<< (long long)
pg_streamoperator<< (unsigned long long)
pg_streamoperator<< (short)
pg_streamoperator<< (unsigned short)
pg_streamoperator<< (double)
pg_streamoperator<< (bool)
pg_streamoperator<< (sql_null)
pg_streamoperator<< (pg_bytea &)
pg_streamoperator>> (short &)
pg_streamoperator>> (unsigned short &)
pg_streamoperator>> (int &)
pg_streamoperator>> (unsigned int &)
pg_streamoperator>> (char *)
pg_streamoperator>> (std::string &)
pg_streamoperator>> (pg_bytea &)
pg_streamoperator>> (double &)
pg_streamoperator>> (bool &)
void prepare (bool prep=true)
void set_cursor (unsigned int step)
void use_bind_variables (bool u=true)
int eof ()
int eos ()
bool val_is_null () const
int affected_rows () const

Protected Member Functions

void init (const char *query, int prepare_mode, unsigned int cursor_step)
 pg_stream (pg_cnx &db)

Protected Attributes

pg_cnxm_db

Private Member Functions

void execute ()
void do_prepare ()
void create_cursor ()
void cursor_fetch ()
void check_binds ()
void reset_results ()
void next_result ()
void check_eof ()
void query_make_space (int len)
void replace_placeholder (unsigned int argpos, const char *buf, int size, bool binary=false)
void next_bind ()
bool check_null ()

Private Attributes

unsigned int m_argpos
char * m_query_buf
int m_query_bufsize
int m_query_len
int m_initial_query_len
char m_localQueryBuf [1024+1]
std::string m_query_fmt
int m_chunk_size
std::vector< sql_bind_paramm_vars
unsigned int m_query_hash
int m_executed
PGresult * m_pg_res
int m_row_number
int m_col_number
bool m_val_null
int m_affected_rows
int m_cursor_step
bool m_prepare_wanted
std::string m_prepare_name
std::string m_cursor_name
bool m_inline_params

Static Private Attributes

static int m_uniq_cnt = 0

Detailed Description

pg_stream class. Allows the parametrized execution of a query and retrieval of results in a stream

Definition at line 206 of file pgstream.hpp.


Constructor & Destructor Documentation

pgs::pg_stream::pg_stream ( const char *  query,
pg_cnx db,
int  prepare_mode = 2 
)

constructor

Definition at line 109 of file pgstream.cpp.

Here is the call graph for this function:

pgs::pg_stream::pg_stream ( const std::string  query,
pg_cnx db,
int  prepare_mode = 2 
)

Definition at line 103 of file pgstream.cpp.

Here is the call graph for this function:

pgs::pg_stream::~pg_stream ( )
virtual

Definition at line 194 of file pgstream.cpp.

Here is the call graph for this function:

pgs::pg_stream::pg_stream ( pg_cnx db)
inlineprotected

Definition at line 268 of file pgstream.hpp.


Member Function Documentation

int pgs::pg_stream::affected_rows ( ) const
inline

Definition at line 263 of file pgstream.hpp.

Here is the caller graph for this function:

void pgs::pg_stream::check_binds ( )
private

Definition at line 622 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pgs::pg_stream::check_eof ( )
private

Definition at line 823 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool pgs::pg_stream::check_null ( )
private

Definition at line 816 of file pgstream.cpp.

Here is the caller graph for this function:

void pgs::pg_stream::create_cursor ( )
private

Definition at line 246 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pgs::pg_stream::cursor_fetch ( )
private

Definition at line 769 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pgs::pg_stream::do_prepare ( )
private

Definition at line 216 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int pgs::pg_stream::eof ( )
returns true if there are no more results to read from the stream,

or false otherwise

Definition at line 790 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int pgs::pg_stream::eos ( )
inline

Definition at line 259 of file pgstream.hpp.

Here is the caller graph for this function:

void pgs::pg_stream::execute ( )
private

send the query to the server

Definition at line 678 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pgs::pg_stream::init ( const char *  query,
int  prepare_mode,
unsigned int  cursor_step 
)
protected

Definition at line 116 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pgs::pg_stream::next_bind ( )
private

Definition at line 350 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pgs::pg_stream::next_result ( )
private

Definition at line 808 of file pgstream.cpp.

Here is the caller graph for this function:

pg_stream & pgs::pg_stream::operator<< ( const char *  p)

assign a char* parameter

Definition at line 358 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pg_stream & pgs::pg_stream::operator<< ( const std::string &  s)

Definition at line 402 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( int  i)

assign an int parameter

Definition at line 408 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( unsigned int  i)

Definition at line 427 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( long  l)

Definition at line 439 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( unsigned long  l)

Definition at line 458 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( long long  l)

Definition at line 470 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( unsigned long long  l)

Definition at line 489 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( short  s)

Definition at line 501 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( unsigned short  s)

Definition at line 513 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( double  d)

Definition at line 525 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( bool  b)

Definition at line 537 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( sql_null  n)

Definition at line 613 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator<< ( pg_bytea b)

Definition at line 569 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( short &  s)

Definition at line 853 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( unsigned short &  s)

Definition at line 867 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( int &  i)

Definition at line 880 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( unsigned int &  i)

Definition at line 892 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( char *  p)

Definition at line 935 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( std::string &  s)

Definition at line 950 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( pg_bytea b)

Definition at line 830 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( double &  d)

Definition at line 906 of file pgstream.cpp.

Here is the call graph for this function:

pg_stream & pgs::pg_stream::operator>> ( bool &  b)

Definition at line 918 of file pgstream.cpp.

Here is the call graph for this function:

void pgs::pg_stream::prepare ( bool  prep = true)
inline

Definition at line 243 of file pgstream.hpp.

void pgs::pg_stream::query_make_space ( int  len)
private

Definition at line 278 of file pgstream.cpp.

Here is the caller graph for this function:

void pgs::pg_stream::replace_placeholder ( unsigned int  argpos,
const char *  buf,
int  size,
bool  binary = false 
)
private

Definition at line 308 of file pgstream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pgs::pg_stream::reset_results ( )
private

Definition at line 261 of file pgstream.cpp.

Here is the caller graph for this function:

void pgs::pg_stream::set_cursor ( unsigned int  step)
inline

Definition at line 246 of file pgstream.hpp.

void pgs::pg_stream::use_bind_variables ( bool  u = true)
inline

Definition at line 249 of file pgstream.hpp.

bool pgs::pg_stream::val_is_null ( ) const
inline

Definition at line 260 of file pgstream.hpp.

Here is the caller graph for this function:


Member Data Documentation

int pgs::pg_stream::m_affected_rows
private

Definition at line 303 of file pgstream.hpp.

unsigned int pgs::pg_stream::m_argpos
private

Definition at line 287 of file pgstream.hpp.

int pgs::pg_stream::m_chunk_size
private

Definition at line 294 of file pgstream.hpp.

int pgs::pg_stream::m_col_number
private

Definition at line 301 of file pgstream.hpp.

std::string pgs::pg_stream::m_cursor_name
private

Definition at line 307 of file pgstream.hpp.

int pgs::pg_stream::m_cursor_step
private

Definition at line 304 of file pgstream.hpp.

pg_cnx& pgs::pg_stream::m_db
protected

Definition at line 269 of file pgstream.hpp.

int pgs::pg_stream::m_executed
private

Definition at line 298 of file pgstream.hpp.

int pgs::pg_stream::m_initial_query_len
private

Definition at line 291 of file pgstream.hpp.

bool pgs::pg_stream::m_inline_params
private

Definition at line 313 of file pgstream.hpp.

char pgs::pg_stream::m_localQueryBuf[1024+1]
private

Definition at line 292 of file pgstream.hpp.

PGresult* pgs::pg_stream::m_pg_res
private

Definition at line 299 of file pgstream.hpp.

std::string pgs::pg_stream::m_prepare_name
private

Definition at line 306 of file pgstream.hpp.

bool pgs::pg_stream::m_prepare_wanted
private

Definition at line 305 of file pgstream.hpp.

char* pgs::pg_stream::m_query_buf
private

Definition at line 288 of file pgstream.hpp.

int pgs::pg_stream::m_query_bufsize
private

Definition at line 289 of file pgstream.hpp.

std::string pgs::pg_stream::m_query_fmt
private

Definition at line 293 of file pgstream.hpp.

unsigned int pgs::pg_stream::m_query_hash
private

Definition at line 296 of file pgstream.hpp.

int pgs::pg_stream::m_query_len
private

Definition at line 290 of file pgstream.hpp.

int pgs::pg_stream::m_row_number
private

Definition at line 300 of file pgstream.hpp.

int pgs::pg_stream::m_uniq_cnt = 0
staticprivate

Definition at line 316 of file pgstream.hpp.

bool pgs::pg_stream::m_val_null
private

Definition at line 302 of file pgstream.hpp.

std::vector<sql_bind_param> pgs::pg_stream::m_vars
private

Definition at line 295 of file pgstream.hpp.


The documentation for this class was generated from the following files: