c++/MQDB/MappedQuery.cpp
/******************************************* 
  stream_multiple

  Description: General purpose template function for fetching multiple instance
               of this class(subclass) using the create(row_map, database) method to convert
               a row of data into an object. Instead of instantiating all
               instance at once and returning as array, this method returns
               a DBStream instance which then creates each instance from an
               open handle on each $stream->next_in_stream() call.
  Arg (1)    : $database (MQDB::Database)
  Arg (2)    : $sql (string of SQL statement with place holders)
  Arg (3...) : optional parameters to map to the placehodlers within the SQL
  Returntype : DBStream object
  Exceptions : none
  Caller     : subclasses use this internally when creating new API stream_by....() methods
  Example    :
                  sub stream_by_value {
                      my $class = shift;
                      my $db = shift;
                      my $name = shift;
                      my $sql = "SELECT * FROM symbol WHERE sym_value=?";
                      return $class->stream_multiple($db, $sql, $name);
                  }
                  
*******************************************/
stream_multiple
Description: General purpose template function for fetching multiple instance
of this class(subclass) using the create(row_map, database) method to convert
a row of data into an object. Instead of instantiating all
instance at once and returning as array, this method returns
a DBStream instance which then creates each instance from an
open handle on each $stream->next_in_stream() call.
stream_multiple Description : General purpose template function for fetching multiple instance of this class ( subclass ) using the create ( row_map database ) method to convert a row of data into an object . Instead of instantiating all instance at once and returning as array this method returns a DBStream instance which then creates each instance from an open handle on each $stream - > next_in_stream () call .
MQDB::DBStream* 
MQDB::stream_multiple(DBObject* (*createFunc)(map<string, dynadata> &row_map, Database* db), 
                      Database *db, const char* sql, const char* fmt, ...)
{
  va_list  ap;
  va_start(ap, fmt);
  MQDB::DBStream* stream = new MQDB::DBStream;
  if(db == NULL) { return stream; }
  stream->database(db);
  stream->class_create(createFunc);
  stream->prepare_sql(sql, fmt, ap);
  va_end(ap);
  return stream;
}
MQDB :: DBStream * MQDB :: stream_multiple ( DBObject * ( * createFunc ) ( map < string , dynadata > & row_map , Database * db ) , Database * db , const char * sql , const char * fmt , ... ) { va_list ap ; va_start ( ap , fmt ) ; MQDB :: DBStream * stream = new MQDB :: DBStream ; if ( db == NULL ) { return stream ; } stream -> database ( db ) ; stream -> class_create ( createFunc ) ; stream -> prepare_sql ( sql , fmt , ap ) ; va_end ( ap ) ; return stream ; }
stream_multiple
Description: General purpose template function for fetching multiple instance
of this class(subclass) using the create(row_map, database) method to convert
a row of data into an object.
stream_multiple Description : General purpose template function for fetching multiple instance of this class ( subclass ) using the create ( row_map database ) method to convert a row of data into an object .