oasys::SQLExtract Class Reference

#include <SQLSerialize.h>

Inheritance diagram for oasys::SQLExtract:

oasys::SerializeAction oasys::Serialize List of all members.

Detailed Description

SQLExtract is a SerializeAction that constructs an object's internals from the results of a SQL "select" statement.

Definition at line 197 of file SQLSerialize.h.

Public Member Functions

 SQLExtract (SQLImplementation *impl)
 Constructor.
const char * next_field ()
void process (const char *name, u_int32_t *i)
 Process function for a 4 byte integer.
void process (const char *name, u_int16_t *i)
 Process function for a 2 byte integer.
void process (const char *name, u_int8_t *i)
 Process function for a byte.
void process (const char *name, bool *b)
 Process function for a boolean.
void process (const char *name, u_char *bp, size_t len)
 Process function for a constant length char buffer.
void process (const char *name, u_char **bp, size_t *lenp, int flags)
 Process function for a variable length char buffer.
void process (const char *name, std::string *s)
 Process function for a c++ string.

Protected Attributes

int field_
 counter over the fields in the returned tuple

Private Attributes

SQLImplementationsql_impl_


Constructor & Destructor Documentation

oasys::SQLExtract::SQLExtract ( SQLImplementation impl  ) 

Constructor.

Definition at line 423 of file SQLSerialize.cc.

References field_, and sql_impl_.


Member Function Documentation

const char * oasys::SQLExtract::next_field (  ) 

Definition at line 432 of file SQLSerialize.cc.

References field_, oasys::SQLImplementation::get_value(), and sql_impl_.

Referenced by process().

void oasys::SQLExtract::process ( const char *  name,
u_int32_t *  i 
) [virtual]

Process function for a 4 byte integer.

Implements oasys::SerializeAction.

Definition at line 438 of file SQLSerialize.cc.

References oasys::SerializeAction::log_, oasys::LOG_DEBUG, oasys::logf(), and next_field().

void oasys::SQLExtract::process ( const char *  name,
u_int16_t *  i 
) [virtual]

Process function for a 2 byte integer.

Implements oasys::SerializeAction.

Definition at line 450 of file SQLSerialize.cc.

References oasys::SerializeAction::log_, oasys::LOG_DEBUG, oasys::logf(), and next_field().

void oasys::SQLExtract::process ( const char *  name,
u_int8_t *  i 
) [virtual]

Process function for a byte.

Implements oasys::SerializeAction.

Definition at line 462 of file SQLSerialize.cc.

References oasys::SerializeAction::log_, oasys::LOG_DEBUG, oasys::logf(), and next_field().

void oasys::SQLExtract::process ( const char *  name,
bool b 
) [virtual]

Process function for a boolean.

Implements oasys::SerializeAction.

Definition at line 474 of file SQLSerialize.cc.

References oasys::SerializeAction::log_, oasys::LOG_DEBUG, oasys::LOG_ERR, oasys::logf(), next_field(), and oasys::SerializeAction::signal_error().

void oasys::SQLExtract::process ( const char *  name,
u_char *  bp,
size_t  len 
) [virtual]

Process function for a constant length char buffer.

Parameters:
name field name
bp buffer
len buffer length

Implements oasys::SerializeAction.

Definition at line 519 of file SQLSerialize.cc.

References oasys::hex2str(), oasys::SerializeAction::log_, oasys::LOG_DEBUG, oasys::logf(), next_field(), sql_impl_, and oasys::SQLImplementation::unescape_binary().

void oasys::SQLExtract::process ( const char *  name,
u_char **  bp,
size_t *  lenp,
int  flags 
) [virtual]

Process function for a variable length char buffer.

Parameters:
name field name
bp buffer, allocated by SerializeAction if ALLOC_MEM flag is set.
lenp IN: If ALLOC_MEM flags is set, then len is the length of the buffer allocated. OUT: contains the length of the buffer
flags ALLOC_MEM as above, NULL_TERMINATED specifies that the data stored will be a null-terminated C-string.

Implements oasys::SerializeAction.

Definition at line 539 of file SQLSerialize.cc.

References NOTIMPLEMENTED.

void oasys::SQLExtract::process ( const char *  name,
std::string *  s 
) [virtual]

Process function for a c++ string.

Implements oasys::SerializeAction.

Definition at line 504 of file SQLSerialize.cc.

References oasys::SerializeAction::log_, oasys::LOG_DEBUG, oasys::logf(), and next_field().


Member Data Documentation

int oasys::SQLExtract::field_ [protected]

counter over the fields in the returned tuple

Definition at line 214 of file SQLSerialize.h.

Referenced by next_field(), and SQLExtract().

SQLImplementation* oasys::SQLExtract::sql_impl_ [private]

Definition at line 217 of file SQLSerialize.h.

Referenced by next_field(), process(), and SQLExtract().


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:06 2006 for DTN Reference Implementation by  doxygen 1.5.1