Optimized Belief Propagation (CPU and GPU)
RunData Class Reference

Class to store headers with data corresponding to current program run and evaluation. More...

#include <RunData.h>

Public Member Functions

void AddDataWHeader (const std::string &header, const std::string &data)
 Add string data with header describing added data. More...
 
void AddDataWHeader (const std::string &header, const char *data)
 Add const char* data with header describing added data. More...
 
void AddDataWHeader (const std::string &header, double data)
 Add double data with header describing added data. More...
 
void AddDataWHeader (const std::string &header, bool data)
 Add boolean data with header describing added data. More...
 
void AddDataWHeader (const std::string &header, unsigned int data)
 Add unsigned int data with header describing added data. More...
 
const std::vector< std::string > & HeadersInOrder () const
 Return data headers in order. More...
 
bool IsData (const std::string_view header) const
 Return whether or not there is data corresponding to a specific header. More...
 
std::string GetDataAsStr (const std::string_view header) const
 Get data corresponding to header as a string Returns data as string regardless of underlying data type. More...
 
std::optional< double > GetDataAsDouble (const std::string_view header) const
 Get data corresponding to header as double Return null if data corresponds to a different data type. More...
 
std::optional< unsigned int > GetDataAsUInt (const std::string_view header) const
 Get data corresponding to header as unsigned int Return null if data corresponds to a different data type. More...
 
std::optional< bool > GetDataAsBool (const std::string_view header) const
 Get data corresponding to header as boolean Return null if data corresponds to a different data type. More...
 
void AppendData (const RunData &rundata)
 Append current RunData with input RunData. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const RunData &run_data)
 Overloaded << operator for output to stream. More...
 

Detailed Description

Class to store headers with data corresponding to current program run and evaluation.

Definition at line 42 of file RunData.h.

Member Function Documentation

◆ AddDataWHeader() [1/5]

void RunData::AddDataWHeader ( const std::string &  header,
bool  data 
)

Add boolean data with header describing added data.

Parameters
header
data

Definition at line 79 of file RunData.cpp.

◆ AddDataWHeader() [2/5]

void RunData::AddDataWHeader ( const std::string &  header,
const char *  data 
)

Add const char* data with header describing added data.

Parameters
header
data

Definition at line 59 of file RunData.cpp.

◆ AddDataWHeader() [3/5]

void RunData::AddDataWHeader ( const std::string &  header,
const std::string &  data 
)

Add string data with header describing added data.

Parameters
header
data

Definition at line 49 of file RunData.cpp.

Here is the caller graph for this function:

◆ AddDataWHeader() [4/5]

void RunData::AddDataWHeader ( const std::string &  header,
double  data 
)

Add double data with header describing added data.

Parameters
header
data

Definition at line 69 of file RunData.cpp.

◆ AddDataWHeader() [5/5]

void RunData::AddDataWHeader ( const std::string &  header,
unsigned int  data 
)

Add unsigned int data with header describing added data.

Parameters
header
data

Definition at line 89 of file RunData.cpp.

◆ AppendData()

void RunData::AppendData ( const RunData rundata)

Append current RunData with input RunData.

Parameters
rundata

Definition at line 99 of file RunData.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDataAsBool()

std::optional< bool > RunData::GetDataAsBool ( const std::string_view  header) const

Get data corresponding to header as boolean Return null if data corresponds to a different data type.

Parameters
header
Returns
Data corresponding to header as bool if data is bool, null if not

Definition at line 167 of file RunData.cpp.

Here is the caller graph for this function:

◆ GetDataAsDouble()

std::optional< double > RunData::GetDataAsDouble ( const std::string_view  header) const

Get data corresponding to header as double Return null if data corresponds to a different data type.

Parameters
header
Returns
Data corresponding to header as double if data is double, null if not

Definition at line 142 of file RunData.cpp.

Here is the caller graph for this function:

◆ GetDataAsStr()

std::string RunData::GetDataAsStr ( const std::string_view  header) const

Get data corresponding to header as a string Returns data as string regardless of underlying data type.

Parameters
header
Returns
Data corresponding to header as a string

Definition at line 118 of file RunData.cpp.

Here is the caller graph for this function:

◆ GetDataAsUInt()

std::optional< unsigned int > RunData::GetDataAsUInt ( const std::string_view  header) const

Get data corresponding to header as unsigned int Return null if data corresponds to a different data type.

Parameters
header
Returns
Data corresponding to header as unsigned int if data is unsigned int, null if not

Definition at line 155 of file RunData.cpp.

Here is the caller graph for this function:

◆ HeadersInOrder()

const std::vector<std::string>& RunData::HeadersInOrder ( ) const
inline

Return data headers in order.

Returns
Data headers in order

Definition at line 89 of file RunData.h.

Here is the caller graph for this function:

◆ IsData()

bool RunData::IsData ( const std::string_view  header) const
inline

Return whether or not there is data corresponding to a specific header.

Parameters
header
Returns
true if there is run data corresponding to header, false if not

Definition at line 97 of file RunData.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RunData run_data 
)
friend

Overloaded << operator for output to stream.

Parameters
os
run_data
Returns
Output stream with run data added

Definition at line 178 of file RunData.h.


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