23 #include <boost/algorithm/string.hpp> 29 using boost::to_upper;
32 map<ClusterType, string> g_cluster_type_name {
33 make_pair(ClusterType::Household,
"household"),
34 make_pair(ClusterType::School,
"school"),
35 make_pair(ClusterType::Work,
"work"),
36 make_pair(ClusterType::PrimaryCommunity,
"primary_community"),
37 make_pair(ClusterType::SecondaryCommunity,
"secondary_community"),
38 make_pair(ClusterType::Null,
"null")
41 map<string, ClusterType> g_name_cluster_type {
42 make_pair(
"HOUSEHOLD", ClusterType::Household),
43 make_pair(
"SCHOOL", ClusterType::School),
44 make_pair(
"WORK", ClusterType::Work),
45 make_pair(
"PRIMARY_COMMUNITY", ClusterType::PrimaryCommunity),
46 make_pair(
"SECONDARY_COMMUNITY", ClusterType::SecondaryCommunity),
47 make_pair(
"NULL", ClusterType::Null)
55 return (g_cluster_type_name.count(c) == 1) ? g_cluster_type_name[c] :
"Null";
61 return (g_name_cluster_type.count(t) == 1);
67 return (g_name_cluster_type.count(t) == 1) ? g_name_cluster_type[t] : ClusterType::Null;
string toString(ClusterType c)
Converts a ClusterType value to corresponding name.
Time Dependent Person DataType.
ClusterType toClusterType(const string &s)
Converts a string with name to ClusterType value.
bool isClusterType(const string &s)
Check whether string is name of a ClusterType value.
Definition of ClusterType.
ClusterType
Enumerates the cluster types.