NANDRAD Data Model Library  Version 2.0
NANDRAD
NANDRAD::DataTable Class Reference

Detailed Description

A data member for a table with named columns.

Definition at line 32 of file NANDRAD_DataTable.h.

#include <NANDRAD_DataTable.h>

Public Member Functions

bool operator!= (const DataTable &other) const
 Inequility operator. More...
 
void setEncodedString (const std::string &str)
 Sets content of data table from encoded string. More...
 
std::string encodedString () const
 Returns content of data table as encoded string using tab a value separator. More...
 
const std::vector< double > & valueVector (const std::string &parameterName) const
 Convenience function that looks up a parameter data vector in the map and returns a const reference to it. More...
 

Public Attributes

std::map< std::string, std::vector< double > > m_values
 The actual data member. More...
 

Member Function Documentation

◆ operator!=()

bool NANDRAD::DataTable::operator!= ( const DataTable other) const
inline

Inequility operator.

Definition at line 36 of file NANDRAD_DataTable.h.

◆ setEncodedString()

void NANDRAD::DataTable::setEncodedString ( const std::string &  str)

Sets content of data table from encoded string.

Setting the following string "Col1:1 5 3;Col2:7 2 2" is equivalent to executing the following code:

m_values["Col1"] = std::vector<double>{1,5,3};
m_values["Col2"] = std::vector<double>{7,2,2};

Throws an IBK::Exception, if number of rows in columns mismatches.

Note
It is possible to use , and a whitespace (space or tab) character as number separator.

◆ encodedString()

std::string NANDRAD::DataTable::encodedString ( ) const

Returns content of data table as encoded string using tab a value separator.

◆ valueVector()

const std::vector<double>& NANDRAD::DataTable::valueVector ( const std::string &  parameterName) const

Convenience function that looks up a parameter data vector in the map and returns a const reference to it.

Throws an IBK::Exception if the parameter name doesn't exist.

Member Data Documentation

◆ m_values

std::map<std::string, std::vector<double> > NANDRAD::DataTable::m_values

The actual data member.

Definition at line 64 of file NANDRAD_DataTable.h.


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