本文整理汇总了C++中IArchive::startObject方法的典型用法代码示例。如果您正苦于以下问题:C++ IArchive::startObject方法的具体用法?C++ IArchive::startObject怎么用?C++ IArchive::startObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IArchive
的用法示例。
在下文中一共展示了IArchive::startObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serialize
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();
}
示例2: serialize
void serialize(IArchive& ar, pfemp1_antibody_t& antibodies)
{
ar.startObject();
ar.labelElement("minor") & antibodies.minor;
ar.labelElement("major") & antibodies.major;
ar.endObject();
}
示例3: serialize
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();
}