CompositeExecStreamGenerator Class Reference

Generates a result set consisting of columns each generated by its own generator. More...

#include <ExecStreamGenerator.h>

Inheritance diagram for CompositeExecStreamGenerator:

MockProducerExecStreamGenerator List of all members.

Public Member Functions

 CompositeExecStreamGenerator (vector< shared_ptr< ColumnGenerator< int64_t > > > const &generatorsInit)
virtual int64_t generateValue (uint iRow, uint iCol)
 Generates one data value.

Private Member Functions

uint columnCount ()

Private Attributes

vector< boost::shared_ptr<
ColumnGenerator< int64_t > > > 
generators
uint currentRow
uint currentCol

Detailed Description

Generates a result set consisting of columns each generated by its own generator.

Author:
Julian Hyde

Definition at line 254 of file ExecStreamGenerator.h.


Constructor & Destructor Documentation

CompositeExecStreamGenerator::CompositeExecStreamGenerator ( vector< shared_ptr< ColumnGenerator< int64_t > > > const &  generatorsInit  )  [inline, explicit]

Definition at line 261 of file ExecStreamGenerator.h.

References columnCount(), currentCol, and currentRow.

00263         : generators(generatorsInit)
00264     {
00265         currentRow = uint(-1);
00266         currentCol = columnCount() - 1;
00267     }


Member Function Documentation

virtual int64_t CompositeExecStreamGenerator::generateValue ( uint  iRow,
uint  iCol 
) [inline, virtual]

Generates one data value.

Parameters:
iRow 0-based row number to generate
iCol 0-based col number to generate

Implements MockProducerExecStreamGenerator.

Definition at line 269 of file ExecStreamGenerator.h.

References columnCount(), currentCol, currentRow, and generators.

00270     {
00271         // Check that access is sequential.
00272         if (iCol == 0) {
00273             assert(iRow == currentRow + 1);
00274             assert(currentCol == columnCount() - 1);
00275         } else {
00276             assert(iRow == currentRow);
00277             assert(iCol == currentCol + 1);
00278         }
00279         currentRow = iRow;
00280         currentCol = iCol;
00281 
00282         return generators[iCol]->next();
00283     }

uint CompositeExecStreamGenerator::columnCount (  )  [inline, private]

Definition at line 286 of file ExecStreamGenerator.h.

References generators.

Referenced by CompositeExecStreamGenerator(), and generateValue().

00287     {
00288         return generators.size();
00289     }


Member Data Documentation

vector<boost::shared_ptr<ColumnGenerator<int64_t> > > CompositeExecStreamGenerator::generators [private]

Definition at line 256 of file ExecStreamGenerator.h.

Referenced by columnCount(), and generateValue().

uint CompositeExecStreamGenerator::currentRow [private]

Definition at line 257 of file ExecStreamGenerator.h.

Referenced by CompositeExecStreamGenerator(), and generateValue().

uint CompositeExecStreamGenerator::currentCol [private]

Definition at line 258 of file ExecStreamGenerator.h.

Referenced by CompositeExecStreamGenerator(), and generateValue().


The documentation for this class was generated from the following file:
Generated on Mon Jun 22 04:00:29 2009 for Fennel by  doxygen 1.5.1