Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::core Namespace Reference

Top-level namespace for Health-GPS Core C++ API. More...

Namespaces

 detail
 

Classes

struct  LifeExpectancyItem
 Life expectancy item for a country data structure. More...
 
struct  DiseaseAnalysisEntity
 Burden of Diseases (BoD) analysis for a country data structure. More...
 
struct  LmsDataRow
 LMS (lambda-mu-sigma) parameters data structure. More...
 
class  Array2D
 Defines a contiguous storage for two-dimensional numerical data in row-major format. More...
 
class  DataTableColumn
 DataTable columns interface data type. More...
 
class  PrimitiveDataTableColumnBuilder
 Primitive data type DataTable column builder class. More...
 
class  DataTableColumnIterator
 DataTable column iterator data type class. More...
 
class  FloatDataTableColumn
 DataTable column for storing float data type class. More...
 
class  DoubleDataTableColumn
 DataTable column for storing double data type class. More...
 
class  IntegerDataTableColumn
 DataTable column for storing integer data type class. More...
 
class  PrimitiveDataTableColumn
 Primitive data type DataTable columns class. More...
 
class  StringDataTableColumn
 DataTable column for storing string data type class. More...
 
struct  Country
 Country ISO-3166 definition data structure. More...
 
class  Datastore
 Defines the Health-GPS back-end data store interface for all implementations. More...
 
class  DataTable
 Defines a Datatable for in memory data class. More...
 
struct  DiseaseInfo
 Disease information structure. More...
 
struct  DiseaseItem
 Disease data item structure. More...
 
struct  DiseaseEntity
 Disease full definition data structure. More...
 
struct  RelativeRiskEntity
 Diseases relative risk effect table data structure. More...
 
struct  CancerParameterEntity
 Cancer disease parameters per country data structure. More...
 
struct  LookupGenderValue
 Lookup table entry for gender values. More...
 
struct  Identifier
 Entity unique identifier data type. More...
 
struct  BirthItem
 Birth rate indicator for a country data structure. More...
 
class  Interval
 Numeric interval representation data type. More...
 
class  MathHelper
 Additional mathematical functions and determines the parameters of the floating point representation. More...
 
struct  MortalityItem
 Population mortality trends for a country data structure. More...
 
struct  PopulationItem
 Population trends item data structure. More...
 
class  ScopedTimer
 Timer to printout scope execution time in milliseconds. More...
 
struct  case_insensitive
 Case-insensitive operations on ASCII strings. More...
 
class  UnivariateSummary
 Defines an univariate statistical summary data type. More...
 
class  Version
 Application Programming Interface (API) version data type. More...
 
class  DataTableColumnVisitor
 DataTable column visitor interface. More...
 

Typedefs

using FloatArray2D = Array2D< float >
 Contiguous storage for two-dimensional single precision values. More...
 
using DoubleArray2D = Array2D< double >
 Contiguous storage for two-dimensional double precision values. More...
 
using IntegerArray2D = Array2D< int >
 Contiguous storage for two-dimensional integer values. More...
 
using StringDataTableColumnBuilder = PrimitiveDataTableColumnBuilder< StringDataTableColumn >
 Builder for DataTable columns storing string data type class. More...
 
using FloatDataTableColumnBuilder = PrimitiveDataTableColumnBuilder< FloatDataTableColumn >
 Builder for DataTable columns storing float data type class. More...
 
using DoubleDataTableColumnBuilder = PrimitiveDataTableColumnBuilder< DoubleDataTableColumn >
 Builder for DataTable columns storing double data type class. More...
 
using IntegerDataTableColumnBuilder = PrimitiveDataTableColumnBuilder< IntegerDataTableColumn >
 Builder for DataTable columns storing Integer data type class. More...
 
using IntegerInterval = Interval< int >
 Interval representation integer data type. More...
 
using FloatInterval = Interval< float >
 Interval representation for single-precision data type. More...
 
using DoubleInterval = Interval< double >
 Interval representation for double-precision data type. More...
 

Enumerations

enum class  VerboseMode : uint8_t { none , verbose }
 Verbosity mode enumeration. More...
 
enum class  Gender : uint8_t { unknown , male , female }
 Enumerates gender types. More...
 
enum class  DiseaseGroup : uint8_t { other , cancer }
 Enumerates supported diseases types. More...
 

Functions

bool operator> (const Country &lhs, const Country &rhs)
 Greater-than operation for country data type. More...
 
bool operator< (const Country &lhs, const Country &rhs)
 Less-than operation for country data type. More...
 
bool operator< (const DiseaseInfo &lhs, const DiseaseInfo &rhs)
 Determine whether a specified DiseaseInfo is less than another instance. More...
 
bool operator> (const DiseaseInfo &lhs, const DiseaseInfo &rhs)
 Determine whether a specified DiseaseInfo is greater than another instance. More...
 
std::ostream & operator<< (std::ostream &stream, const Identifier &identifier)
 
void from_json (const nlohmann::json &j, Identifier &id)
 
void from_json (const nlohmann::json &j, std::map< Identifier, double > &map)
 
IntegerInterval parse_integer_interval (const std::string_view &value, const std::string_view delims="-")
 Converts the string representation to its IntegerInterval equivalent. More...
 
FloatInterval parse_float_interval (const std::string_view &value, const std::string_view delims="-")
 Converts the string representation to its FloatInterval equivalent. More...
 
DoubleInterval parse_double_interval (const std::string_view &value, const std::string_view delims="-")
 Converts the string representation to its DoubleInterval equivalent. More...
 
bool operator< (MortalityItem const &lhs, MortalityItem const &rhs)
 Determine whether a specified MortalityItem is less than another instance. More...
 
bool operator> (MortalityItem const &lhs, MortalityItem const &rhs)
 Determine whether a specified MortalityItem is greater than another instance. More...
 
bool operator< (PopulationItem const &lhs, PopulationItem const &rhs)
 Determine whether a specified PopulationItem is less than another instance. More...
 
bool operator> (PopulationItem const &lhs, PopulationItem const &rhs)
 Determine whether a specified PopulationItem is greater than another instance. More...
 
std::string trim (std::string value) noexcept
 Trim leading and trailing occurrences of white-space characters from string. More...
 
std::string to_lower (const std::string_view &value) noexcept
 Converts the given ASCII string to lower-case. More...
 
std::string to_upper (const std::string_view &value) noexcept
 Converts the given ASCII string to upper-case. More...
 
std::vector< std::string_view > split_string (const std::string_view &value, std::string_view delims) noexcept
 Splits a string into substrings based on specified delimiting characters. More...
 
template<class F , class... Ts>
auto run_async (F &&action, Ts &&...params)
 Run a given function asynchronous. More...
 
template<class Policy , class Index , class UnaryFunction >
auto parallel_for (Policy &&policy, Index first, Index last, UnaryFunction func)
 Parallel for each over an indexed accessed containers. More...
 
template<class Policy , class T , class UnaryPredicate >
auto find_index_of_all (Policy &&policy, const T &data, UnaryPredicate pred)
 Finds index of all occurrences in a container. More...
 
std::ostream & operator<< (std::ostream &stream, const UnivariateSummary &summary)
 

Variables

template<typename T >
concept Numerical = std::is_arithmetic_v<T>
 C++20 concept for numeric columns types. More...
 
constexpr auto execution_policy = std::execution::par
 Default execution policy. More...
 
constexpr auto API_MAJOR = 1
 Version major number. More...
 
constexpr auto API_MINOR = 2
 Version minor number. More...
 
constexpr auto API_PATCH = 0
 Version patch number. More...
 

Detailed Description

Top-level namespace for Health-GPS Core C++ API.

Typedef Documentation

◆ DoubleArray2D

using hgps::core::DoubleArray2D = typedef Array2D<double>

Contiguous storage for two-dimensional double precision values.

◆ DoubleDataTableColumnBuilder

Builder for DataTable columns storing double data type class.

◆ DoubleInterval

using hgps::core::DoubleInterval = typedef Interval<double>

Interval representation for double-precision data type.

◆ FloatArray2D

using hgps::core::FloatArray2D = typedef Array2D<float>

Contiguous storage for two-dimensional single precision values.

◆ FloatDataTableColumnBuilder

Builder for DataTable columns storing float data type class.

◆ FloatInterval

using hgps::core::FloatInterval = typedef Interval<float>

Interval representation for single-precision data type.

◆ IntegerArray2D

using hgps::core::IntegerArray2D = typedef Array2D<int>

Contiguous storage for two-dimensional integer values.

◆ IntegerDataTableColumnBuilder

Builder for DataTable columns storing Integer data type class.

◆ IntegerInterval

using hgps::core::IntegerInterval = typedef Interval<int>

Interval representation integer data type.

◆ StringDataTableColumnBuilder

Builder for DataTable columns storing string data type class.

Enumeration Type Documentation

◆ DiseaseGroup

enum hgps::core::DiseaseGroup : uint8_t
strong

Enumerates supported diseases types.

Enumerator
other 

Common diseases excluding cancers.

cancer 

Cancer disease.

◆ Gender

enum hgps::core::Gender : uint8_t
strong

Enumerates gender types.

Enumerator
unknown 

Unknown gender.

male 

Male.

female 

Female.

◆ VerboseMode

enum hgps::core::VerboseMode : uint8_t
strong

Verbosity mode enumeration.

Enumerator
none 

only report errors

verbose 

Print more information about actions, including warning.

Function Documentation

◆ find_index_of_all()

template<class Policy , class T , class UnaryPredicate >
auto hgps::core::find_index_of_all ( Policy &&  policy,
const T &  data,
UnaryPredicate  pred 
)

Finds index of all occurrences in a container.

Template Parameters
PolicyExecution policy type
TContainer type
UnaryPredicatePredicate type
Parameters
policyThe execution policy to use
dataThe container to search
predThe predicated object to apply
Returns
A std::vector<size_t> with zero-based index of all occurrences.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_json() [1/2]

void hgps::core::from_json ( const nlohmann::json &  j,
Identifier id 
)

◆ from_json() [2/2]

void hgps::core::from_json ( const nlohmann::json &  j,
std::map< Identifier, double > &  map 
)

◆ operator<() [1/4]

bool hgps::core::operator< ( const Country lhs,
const Country rhs 
)
inline

Less-than operation for country data type.

Parameters
lhsThe left country to compare
rhsThe right country to compare
Returns
true if the left country is less than the left country, otherwise false

◆ operator<() [2/4]

bool hgps::core::operator< ( const DiseaseInfo lhs,
const DiseaseInfo rhs 
)
inline

Determine whether a specified DiseaseInfo is less than another instance.

Parameters
lhsThe first instance to compare.
rhsThe second instance to compare.
Returns
true if left instance is less than right instance; otherwise, false.

◆ operator<() [3/4]

bool hgps::core::operator< ( MortalityItem const &  lhs,
MortalityItem const &  rhs 
)
inline

Determine whether a specified MortalityItem is less than another instance.

Parameters
lhsThe first instance to compare.
rhsThe second instance to compare.
Returns
true if left instance is less than right instance; otherwise, false.

◆ operator<() [4/4]

bool hgps::core::operator< ( PopulationItem const &  lhs,
PopulationItem const &  rhs 
)
inline

Determine whether a specified PopulationItem is less than another instance.

Parameters
lhsThe first instance to compare.
rhsThe second instance to compare.
Returns
true if left instance is less than right instance; otherwise, false.

◆ operator<<() [1/2]

std::ostream& hgps::core::operator<< ( std::ostream &  stream,
const Identifier identifier 
)
Parameters
streamThe stream to output
identifierThe Identifier instance
Returns
The output stream

◆ operator<<() [2/2]

std::ostream& hgps::core::operator<< ( std::ostream &  stream,
const UnivariateSummary summary 
)
Parameters
streamThe stream to output
summaryThe UnivariateSummary instance
Returns
The output stream

◆ operator>() [1/4]

bool hgps::core::operator> ( const Country lhs,
const Country rhs 
)
inline

Greater-than operation for country data type.

Parameters
lhsThe left country to compare
rhsThe right country to compare
Returns
true if the left country is greater than the left country, otherwise false

◆ operator>() [2/4]

bool hgps::core::operator> ( const DiseaseInfo lhs,
const DiseaseInfo rhs 
)
inline

Determine whether a specified DiseaseInfo is greater than another instance.

Parameters
lhsThe first instance to compare.
rhsThe second instance to compare.
Returns
true if left instance is greater than right instance; otherwise, false.

◆ operator>() [3/4]

bool hgps::core::operator> ( MortalityItem const &  lhs,
MortalityItem const &  rhs 
)
inline

Determine whether a specified MortalityItem is greater than another instance.

Parameters
lhsThe first instance to compare.
rhsThe second instance to compare.
Returns
true if left instance is greater than right instance; otherwise, false.

◆ operator>() [4/4]

bool hgps::core::operator> ( PopulationItem const &  lhs,
PopulationItem const &  rhs 
)
inline

Determine whether a specified PopulationItem is greater than another instance.

Parameters
lhsThe first instance to compare.
rhsThe second instance to compare.
Returns
true if left instance is greater than right instance; otherwise, false.

◆ parallel_for()

template<class Policy , class Index , class UnaryFunction >
auto hgps::core::parallel_for ( Policy &&  policy,
Index  first,
Index  last,
UnaryFunction  func 
)

Parallel for each over an indexed accessed containers.

Template Parameters
PolicyExecution policy type
IndexIterator type
UnaryFunctionFunction type
Parameters
policyThe execution policy to use
firstThe first element iterator
lastThe last element iterator
funcThe function object to apply
Returns
none
Here is the caller graph for this function:

◆ parse_double_interval()

DoubleInterval hgps::core::parse_double_interval ( const std::string_view &  value,
const std::string_view  delims = "-" 
)

Converts the string representation to its DoubleInterval equivalent.

Parameters
valueThe string representation to parse.
delimsThe fields delimiter to use.
Returns
The new DoubleInterval instance.
Exceptions
std::invalid_argumentfor invalid integer interval string representation formats.
Here is the call graph for this function:

◆ parse_float_interval()

FloatInterval hgps::core::parse_float_interval ( const std::string_view &  value,
const std::string_view  delims = "-" 
)

Converts the string representation to its FloatInterval equivalent.

Parameters
valueThe string representation to parse.
delimsThe fields delimiter to use.
Returns
The new FloatInterval instance.
Exceptions
std::invalid_argumentfor invalid integer interval string representation formats.
Here is the call graph for this function:

◆ parse_integer_interval()

IntegerInterval hgps::core::parse_integer_interval ( const std::string_view &  value,
const std::string_view  delims = "-" 
)

Converts the string representation to its IntegerInterval equivalent.

Parameters
valueThe string representation to parse.
delimsThe fields delimiter to use.
Returns
The new IntegerInterval instance.
Exceptions
std::invalid_argumentfor invalid integer interval string representation formats.
Here is the call graph for this function:

◆ run_async()

template<class F , class... Ts>
auto hgps::core::run_async ( F &&  action,
Ts &&...  params 
)

Run a given function asynchronous.

Template Parameters
FFunction type
...TsFunction parameters type
Parameters
actionThe action to run
...paramsThe action parameters
Returns
The std::future referring to the function call.
Here is the caller graph for this function:

◆ split_string()

std::vector< std::string_view > hgps::core::split_string ( const std::string_view &  value,
std::string_view  delims 
)
noexcept

Splits a string into substrings based on specified delimiting characters.

Parameters
valueThe source string to split
delimsThe delimiting character to split
Returns
An array whose elements contain the substrings
Here is the caller graph for this function:

◆ to_lower()

std::string hgps::core::to_lower ( const std::string_view &  value)
noexcept

Converts the given ASCII string to lower-case.

Parameters
valueThe string to convert
Returns
The string in lower-case
Here is the caller graph for this function:

◆ to_upper()

std::string hgps::core::to_upper ( const std::string_view &  value)
noexcept

Converts the given ASCII string to upper-case.

Parameters
valueThe string to convert
Returns
The string in upper-case

◆ trim()

std::string hgps::core::trim ( std::string  value)
noexcept

Trim leading and trailing occurrences of white-space characters from string.

Parameters
valueThe string to trim
Returns
The resulting string
Here is the caller graph for this function:

Variable Documentation

◆ API_MAJOR

constexpr auto hgps::core::API_MAJOR = 1
constexpr

Version major number.

◆ API_MINOR

constexpr auto hgps::core::API_MINOR = 2
constexpr

Version minor number.

◆ API_PATCH

constexpr auto hgps::core::API_PATCH = 0
constexpr

Version patch number.

◆ execution_policy

constexpr auto hgps::core::execution_policy = std::execution::par
inlineconstexpr

Default execution policy.

◆ Numerical

template<typename T >
concept hgps::core::Numerical = std::is_arithmetic_v<T>

C++20 concept for numeric columns types.