c++/EEDB/SPStreams/MultiMergeStream.cpp
/***** next_in_stream
  Description: return the next object in the stream stack
               depending on the configuration this will either be an on-the-fly created object
               or an object passed through filters, or a primary object streamed out of database/peer
  Returntype : either an MQDB::DBObject* or NULL if end of stream
*****/
next_in_stream
Description: return the next object in the stream stack
depending on the configuration this will either be an on-the-fly created object
or an object passed through filters, or a primary object streamed out of database/peer
Returntype : either an MQDB::DBObject* or NULL if end of stream
next_in_stream Description : return the next object in the stream stack depending on the configuration this will either be an on - the - fly created object or an object passed through filters or a primary object streamed out of database / peer Returntype : either an MQDB :: DBObject * or NULL if end of stream
MQDB::DBObject* EEDB::SPStreams::MultiMergeStream::_next_in_stream() {
  if(_active_sourcestreams == NULL) { return NULL; }
  EEDB::SPStreams::MultistreamElement *mse = _active_sourcestreams;
  if(mse == NULL) { return NULL; }
  if(mse->stream_is_empty) { return NULL; }
  if(mse->stream == NULL) { return NULL; }
  MQDB::DBObject*  next_obj = mse->current_object;
  mse->current_object = mse->stream->next_in_stream();
  if(mse->current_object == NULL) { mse->stream_is_empty = true; }
  else { 
    mse->input_stream_count++; 
    mse->object_class = MSE_OTHER;
    if(mse->current_object->classname() == EEDB::Feature::class_name)    { mse->object_class = MSE_FEATURE; }
    if(mse->current_object->classname() == EEDB::Expression::class_name) { mse->object_class = MSE_EXPRESS; }
  }
  _resort_active_streams();
  return next_obj;
}
MQDB :: DBObject * EEDB :: SPStreams :: MultiMergeStream :: _next_in_stream ( ) { if ( _active_sourcestreams == NULL ) { return NULL ; } EEDB :: SPStreams :: MultistreamElement * mse = _active_sourcestreams ; if ( mse == NULL ) { return NULL ; } if ( mse -> stream_is_empty ) { return NULL ; } if ( mse -> stream == NULL ) { return NULL ; } MQDB :: DBObject * next_obj = mse -> current_object ; mse -> current_object = mse -> stream -> next_in_stream ( ) ; if ( mse -> current_object == NULL ) { mse -> stream_is_empty = true ; } else { mse -> input_stream_count ++ ; mse -> object_class = MSE_OTHER ; if ( mse -> current_object -> classname ( ) == EEDB :: Feature :: class_name ) { mse -> object_class = MSE_FEATURE ; } if ( mse -> current_object -> classname ( ) == EEDB :: Expression :: class_name ) { mse -> object_class = MSE_EXPRESS ; } } _resort_active_streams ( ) ; return next_obj ; }
next_in_stream
Description: return the next object in the stream stack
depending on the configuration this will either be an on-the-fly created object
or an object passed through filters, or a primary object streamed out of database/peer
Returntype : either an MQDB::DBObject* or NULL if end of stream
next_in_stream Description : return the next object in the stream stack depending on the configuration this will either be an on - the - fly created object or an object passed through filters or a primary object streamed out of database / peer Returntype : either an MQDB :: DBObject * or NULL if end of stream
//array of _sourcestreams is alrady sorted and preloaded so just //grab object from stream at head of array, then prefetch and resort //now reload and resort