oasys::SQLUpdate Class Reference

#include <SQLSerialize.h>

Inheritance diagram for oasys::SQLUpdate:

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

Detailed Description

SQLUpdate is a SerializeAction that builts up a SQL "UPDATE" query statement based on the values in an object.

Definition at line 123 of file SQLSerialize.h.

Public Member Functions

 SQLUpdate (const char *table_name, SQLImplementation *impl)
 Constructor.
virtual void begin_action ()
 By default, do nothing.
virtual void end_action ()
 By default, do nothing.
int action (const SerializableObject *const_object)
 Since update doesn't modify the object, define a variant of action() that operates on a const SerializableObject.
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, int32_t *i)
 Adaptor functions for signed/unsigned compatibility.
void process (const char *name, int16_t *i)
 Adaptor functions for signed/unsigned compatibility.
void process (const char *name, int8_t *i)
 Adaptor functions for signed/unsigned compatibility.
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.


Constructor & Destructor Documentation

oasys::SQLUpdate::SQLUpdate ( const char *  table_name,
SQLImplementation impl 
)

Constructor.

Definition at line 196 of file SQLSerialize.cc.


Member Function Documentation

void oasys::SQLUpdate::begin_action (  )  [virtual]

By default, do nothing.

Reimplemented from oasys::SerializeAction.

Definition at line 204 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), oasys::SQLQuery::query_, and oasys::SQLQuery::table_name_.

void oasys::SQLUpdate::end_action (  )  [virtual]

By default, do nothing.

Reimplemented from oasys::SerializeAction.

Definition at line 210 of file SQLSerialize.cc.

References oasys::StringBuffer::data(), oasys::StringBuffer::length(), and oasys::SQLQuery::query_.

int oasys::SQLUpdate::action ( const SerializableObject const_object  )  [inline]

Since update doesn't modify the object, define a variant of action() that operates on a const SerializableObject.

Definition at line 137 of file SQLSerialize.h.

References oasys::SerializeAction::action().

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

Process function for a 4 byte integer.

Implements oasys::SerializeAction.

Definition at line 218 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), and oasys::SQLQuery::query_.

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

Process function for a 2 byte integer.

Implements oasys::SerializeAction.

Definition at line 225 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), and oasys::SQLQuery::query_.

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

Process function for a byte.

Implements oasys::SerializeAction.

Definition at line 232 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), and oasys::SQLQuery::query_.

void oasys::SQLUpdate::process ( const char *  name,
int32_t *  i 
) [virtual]

Adaptor functions for signed/unsigned compatibility.

Reimplemented from oasys::SerializeAction.

Definition at line 239 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), and oasys::SQLQuery::query_.

void oasys::SQLUpdate::process ( const char *  name,
int16_t *  i 
) [virtual]

Adaptor functions for signed/unsigned compatibility.

Reimplemented from oasys::SerializeAction.

Definition at line 250 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), and oasys::SQLQuery::query_.

void oasys::SQLUpdate::process ( const char *  name,
int8_t *  i 
) [virtual]

Adaptor functions for signed/unsigned compatibility.

Reimplemented from oasys::SerializeAction.

Definition at line 257 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), and oasys::SQLQuery::query_.

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

Process function for a boolean.

Implements oasys::SerializeAction.

Definition at line 264 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), and oasys::SQLQuery::query_.

void oasys::SQLUpdate::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 283 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), oasys::SQLImplementation::escape_binary(), oasys::SQLQuery::query_, and oasys::SQLQuery::sql_impl_.

void oasys::SQLUpdate::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 290 of file SQLSerialize.cc.

References NOTIMPLEMENTED.

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

Process function for a c++ string.

Implements oasys::SerializeAction.

Definition at line 276 of file SQLSerialize.cc.

References oasys::StringBuffer::appendf(), oasys::SQLImplementation::escape_string(), oasys::SQLQuery::query_, and oasys::SQLQuery::sql_impl_.


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