void serialize(IArchive& ar, IndividualHumanMalaria::gametocytes_strain_map_t& mapping) { size_t count = ar.IsWriter() ? mapping.size() : -1; ar.startArray(count); if (ar.IsWriter()) { for (auto& entry : mapping) { StrainIdentity* strain = const_cast<StrainIdentity*>(&entry.first); ar.startObject(); ar.labelElement("key"); serialize(ar, strain); ar.labelElement("value") & entry.second; ar.endObject(); } } else { for (size_t i = 0; i < count; i++) { StrainIdentity* strain; int64_t value; ar.startObject(); ar.labelElement("key"); serialize(ar, strain); ar.labelElement("value") & value; ar.endObject(); mapping[*strain] = value; } } ar.endArray(); }
void serialize(IArchive& ar, pfemp1_antibody_t& antibodies) { ar.startObject(); ar.labelElement("minor") & antibodies.minor; ar.labelElement("major") & antibodies.major; ar.endObject(); }
void VectorProbabilities::serialize(IArchive& ar, VectorProbabilities*& probabilities) { probabilities = ar.IsWriter() ? probabilities : new VectorProbabilities(); ar.startObject(); ar.labelElement("effective_host_population") & probabilities->effective_host_population; ar.labelElement("outdoorareakilling") & probabilities->outdoorareakilling; ar.labelElement("outdoorareakilling_male") & probabilities->outdoorareakilling_male; ar.labelElement("diebeforeattempttohumanfeed") & probabilities->diebeforeattempttohumanfeed; ar.labelElement("diewithoutattemptingfeed") & probabilities->diewithoutattemptingfeed; ar.labelElement("survivewithoutsuccessfulfeed") & probabilities->survivewithoutsuccessfulfeed; ar.labelElement("successfulfeed_animal") & probabilities->successfulfeed_animal; ar.labelElement("successfulfeed_AD") & probabilities->successfulfeed_AD; ar.labelElement("indoorattempttohumanfeed") & probabilities->indoorattempttohumanfeed; ar.labelElement("outdoorattempttohumanfeed") & probabilities->outdoorattempttohumanfeed; ar.labelElement("ADbiocontrol_additional_mortality") & probabilities->ADbiocontrol_additional_mortality; ar.labelElement("outdoor_returningmortality") & probabilities->outdoor_returningmortality; ar.labelElement("indoor_diebeforefeeding") & probabilities->indoor_diebeforefeeding; ar.labelElement("indoor_hostnotavailable") & probabilities->indoor_hostnotavailable; ar.labelElement("indoor_dieduringfeeding") & probabilities->indoor_dieduringfeeding; ar.labelElement("indoor_diepostfeeding") & probabilities->indoor_diepostfeeding; ar.labelElement("indoor_successfulfeed_human") & probabilities->indoor_successfulfeed_human; ar.labelElement("indoor_successfulfeed_AD") & probabilities->indoor_successfulfeed_AD; ar.labelElement("outdoor_diebeforefeeding") & probabilities->outdoor_diebeforefeeding; ar.labelElement("outdoor_hostnotavailable") & probabilities->outdoor_hostnotavailable; ar.labelElement("outdoor_dieduringfeeding") & probabilities->outdoor_dieduringfeeding; ar.labelElement("outdoor_diepostfeeding") & probabilities->outdoor_diepostfeeding; ar.labelElement("outdoor_successfulfeed_human") & probabilities->outdoor_successfulfeed_human; ar.labelElement("sugarTrapKilling") & probabilities->sugarTrapKilling; ar.labelElement("individualRepellentBlock") & probabilities->individualRepellentBlock; ar.labelElement("attraction_ADOV") & probabilities->attraction_ADOV; ar.labelElement("attraction_ADIV") & probabilities->attraction_ADIV; ar.labelElement("kill_livestockfeed") & probabilities->kill_livestockfeed; ar.labelElement("kill_PFV") & probabilities->kill_PFV; ar.labelElement("spatial_repellent") & probabilities->spatial_repellent; ar.labelElement("nooutdoorhumanfound") & probabilities->nooutdoorhumanfound; ar.labelElement("outdoorRestKilling") & probabilities->outdoorRestKilling; ar.endObject(); }