Fledge
An open source edge computing platform for industrial users
ResultSet Class Reference

Result set. More...

#include <resultset.h>

Classes

class  ColumnValue
 
class  Row
 

Public Types

typedef std::vector< Row * >::iterator RowIterator
 

Public Member Functions

 ResultSet (const std::string &json)
 Construct a result set from a JSON document returned from the Fledge storage service. More...
 
 ~ResultSet ()
 Destructor for a result set.
 
unsigned int rowCount () const
 
unsigned int columnCount () const
 
const std::string & columnName (unsigned int column) const
 Return the name of a specific column. More...
 
ColumnType columnType (unsigned int column) const
 Return the type of a specific column. More...
 
ColumnType columnType (const std::string &name) const
 
RowIterator firstRow ()
 Fetch an iterator for the rows in a result set. More...
 
RowIterator nextRow (RowIterator it)
 Given an iterator over the rows in a result set move to the next row in the result set. More...
 
bool isLastRow (RowIterator it) const
 Given an iterator over the rows in a result set return if there this is the last row in the result set. More...
 
bool hasNextRow (RowIterator it) const
 Given an iterator over the rows in a result set return if there are any more rows in the result set. More...
 
unsigned int findColumn (const std::string &name) const
 Find the named column in the result set and return the column index. More...
 
const Rowoperator[] (unsigned long rowNo)
 

Detailed Description

Result set.

Constructor & Destructor Documentation

◆ ResultSet()

ResultSet::ResultSet ( const std::string &  json)

Construct a result set from a JSON document returned from the Fledge storage service.

Parameters
jsonThe JSON document to construct the result set from

Member Function Documentation

◆ columnName()

const string & ResultSet::columnName ( unsigned int  column) const

Return the name of a specific column.

Parameters
column- the column number of the column to return. Columns are numbered from 0
Returns
string& The name of the column
Exceptions
ResultNoSuchColumnExceptionThe specified column does not exist in the result set

◆ columnType()

ColumnType ResultSet::columnType ( unsigned int  column) const

Return the type of a specific column.

Parameters
column- the column number of the column to return. Columns are numbered from 0
Returns
ColumnType The type of the specified column
Exceptions
ResultNoSuchColumnExceptionThe specified column does not exist in the result set

◆ findColumn()

unsigned int ResultSet::findColumn ( const std::string &  name) const

Find the named column in the result set and return the column index.

Parameters
nameThe name of the column to return
Returns
unsigned int The index of the named column
Exceptions
ResultNoSuchColumnExceptionThe named column does not exist in the result set

◆ firstRow()

ResultSet::RowIterator ResultSet::firstRow ( )

Fetch an iterator for the rows in a result set.

The iterator is positioned at the first row in the result set.

◆ hasNextRow()

bool ResultSet::hasNextRow ( RowIterator  it) const

Given an iterator over the rows in a result set return if there are any more rows in the result set.

Parameters
itIterator returned by the firstRow() method
Returns
bool True if there are more rows in the result set

◆ isLastRow()

bool ResultSet::isLastRow ( RowIterator  it) const

Given an iterator over the rows in a result set return if there this is the last row in the result set.

Parameters
itIterator returned by the firstRow() method
Returns
bool True if there are no more rows in the result set

◆ nextRow()

ResultSet::RowIterator ResultSet::nextRow ( RowIterator  it)

Given an iterator over the rows in a result set move to the next row in the result set.

Parameters
itIterator returned by the firstRow() method
Returns
RowIterator New value of the iterator
Exceptions
ResultNoMoreRowsExceptionThere are no more rows in the result set

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