Jazz 1.25.+
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Private Attributes
jazz_bebop::ColSelection Class Reference

ColSelection: A selection of columns from a Space. More...

#include <space.h>

Public Member Functions

 ColSelection (pChar query, pSpace p_space)
 The constructor for a ColSelection.
 
virtual bool restart ()
 ColSelection: Restart the iterator.
 
virtual int next_index ()
 ColSelection: Get the next column index.
 
virtual pName next_name ()
 ColSelection: Get the next column name.
 

Data Fields

bool is_valid = false
 True if the iterator was created by a successful query.
 

Private Attributes

int current_col = 0
 The index of the current column (the next to be retrieved).
 
stdNames name = {}
 The list of column names in the selection.
 
std::vector< int > index = {}
 The list of column indices in the selection.
 

Detailed Description

ColSelection: A selection of columns from a Space.

The interface is consistent with RowSelection, but unlike RowSelection the parent class is probably all you need.

See also
Space

Constructor & Destructor Documentation

◆ ColSelection()

jazz_bebop::ColSelection::ColSelection ( pChar  query,
pSpace  p_space 
)

The constructor for a ColSelection.

The constructor will parse the query and create a list of column names and indices. These will not change during the lifetime of the object.

Parameters
queryBy default, a list of comma separated column names. A descendant may define a different interface. In Bop, this is the content of a SELECT clause.
p_spaceThe Space that created the object is required to call col_index().

Member Function Documentation

◆ restart()

bool jazz_bebop::ColSelection::restart ( )
virtual

ColSelection: Restart the iterator.

Returns
true if successful, false failed or was already pointing to the first element.

◆ next_index()

int jazz_bebop::ColSelection::next_index ( )
virtual

ColSelection: Get the next column index.

Returns
The next column index or -i if the iteration is exhausted.

◆ next_name()

pName jazz_bebop::ColSelection::next_name ( )
virtual

ColSelection: Get the next column name.

Returns
The next column name or nullptr if the iteration is exhausted.

The documentation for this class was generated from the following files: