CYCLUS
Loading...
Searching...
No Matches
cyclus::QueryResult Class Reference

Detailed Description

Meta data and results of a query.

Definition at line 426 of file query_backend.h.

#include <query_backend.h>

Public Member Functions

template<class T >
T GetVal (std::string field, int row=0)
 
void Reset ()
 

Public Attributes

std::vector< std::string > fields
 
std::vector< QueryRowrows
 
std::vector< DbTypestypes
 

Member Function Documentation

◆ GetVal()

template<class T >
T cyclus::QueryResult::GetVal ( std::string field,
int row = 0 )
inline

Convenience method for retrieving a value from a specific row and named field (column).

The caller is responsible for specifying a valid templated type to cast to. Example use:

for (int i = 0; i < qr.rows.size(); ++i) {
std::cout << qr.GetVal<int>("field1", i) << "\n";
std::cout << qr.GetVal<double>("field2", i) << "\n";
std::cout << qr.GetVal<std::string>("field3", i) << "\n";
}
Meta data and results of a query.
T GetVal(std::string field, int row=0)
Convenience method for retrieving a value from a specific row and named field (column).
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters

Definition at line 459 of file query_backend.h.

◆ Reset()

void cyclus::QueryResult::Reset ( )
inline

Definition at line 437 of file query_backend.h.

Member Data Documentation

◆ fields

std::vector<std::string> cyclus::QueryResult::fields

names of each field returned by a query

Definition at line 429 of file query_backend.h.

◆ rows

std::vector<QueryRow> cyclus::QueryResult::rows

ordered results of a query

Definition at line 435 of file query_backend.h.

◆ types

std::vector<DbTypes> cyclus::QueryResult::types

types of each field returned by a query.

Definition at line 432 of file query_backend.h.


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