本文整理汇总了C++中IArchive::serialize方法的典型用法代码示例。如果您正苦于以下问题:C++ IArchive::serialize方法的具体用法?C++ IArchive::serialize怎么用?C++ IArchive::serialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IArchive
的用法示例。
在下文中一共展示了IArchive::serialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serialize
void FlowControllerImpl::serialize(IArchive& ar, FlowControllerImpl* obj)
{
FlowControllerImpl& flow = *obj;
ar.labelElement("rate_ratio" ); ar.serialize( flow.rate_ratio, Gender::COUNT );
ar.labelElement("desired_flow" ) & flow.desired_flow;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!! Needs to be set during serialization
//IPairFormationAgent* pair_formation_agent;
//IPairFormationStats* pair_formation_stats;
//IPairFormationRateTable* rate_table;
//const IPairFormationParameters* parameters;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
示例2: serialize
void PairFormationParametersImpl::serialize(IArchive& ar, PairFormationParametersImpl* obj)
{
PairFormationParametersImpl& parameters = *obj;
ar.labelElement("rel_type" ) & (uint32_t&)parameters.rel_type;
ar.labelElement("male_age_bin_count" ) & parameters.male_age_bin_count;
ar.labelElement("initial_male_age" ) & parameters.initial_male_age;
ar.labelElement("male_age_increment" ) & parameters.male_age_increment;
ar.labelElement("female_age_bin_count" ) & parameters.female_age_bin_count;
ar.labelElement("initial_female_age" ) & parameters.initial_female_age;
ar.labelElement("female_age_increment" ) & parameters.female_age_increment;
ar.labelElement("rate_ratio" ); ar.serialize( parameters.rate_ratio, Gender::COUNT );
ar.labelElement("age_bins" ) & parameters.age_bins;
ar.labelElement("joint_probabilities" ) & parameters.joint_probabilities;
ar.labelElement("cumulative_joint_probabilities") & parameters.cumulative_joint_probabilities;
ar.labelElement("marginal_values" ) & parameters.marginal_values;
ar.labelElement("update_period" ) & parameters.update_period;
ar.labelElement("formation_rate_type" ) & (uint32_t&)parameters.formation_rate_type;
ar.labelElement("formation_rate_constant" ) & parameters.formation_rate_constant;
ar.labelElement("formation_rate_sigmoid" ) & parameters.formation_rate_sigmoid;
ar.labelElement("formation_rate_value_map" ) & (std::map<float,float>&)parameters.formation_rate_value_map;
}
示例3: serialize
void IndividualHumanMalaria::serialize(IArchive& ar, IndividualHumanMalaria* obj)
{
IndividualHumanVector::serialize(ar, obj);
IndividualHumanMalaria& individual = *obj;
ar.labelElement("m_inv_microliters_blood") & individual.m_inv_microliters_blood;
ar.labelElement("m_male_gametocytes") & individual.m_male_gametocytes;
ar.labelElement("m_female_gametocytes") & individual.m_female_gametocytes;
ar.labelElement("m_male_gametocytes_by_strain"); Kernel::serialize(ar, individual.m_male_gametocytes_by_strain);
ar.labelElement("m_female_gametocytes_by_strain"); Kernel::serialize(ar, individual.m_female_gametocytes_by_strain);
ar.labelElement("m_parasites_detected_by_blood_smear") & individual.m_parasites_detected_by_blood_smear;
ar.labelElement("m_parasites_detected_by_new_diagnostic") & individual.m_parasites_detected_by_new_diagnostic;
ar.labelElement("m_gametocytes_detected") & individual.m_gametocytes_detected;
ar.labelElement("m_clinical_symptoms"); ar.serialize( individual.m_clinical_symptoms, ClinicalSymptomsEnum::CLINICAL_SYMPTOMS_COUNT);
ar.labelElement("m_initial_infected_hepatocytes") & individual.m_initial_infected_hepatocytes;
// ----------------------------------------------------------------------
// --- This is a pointer to an object held in the Susceptibility object.
// --- It will be re-set after de-serialization. See SetContextTo()
// ----------------------------------------------------------------------
//ar.labelElement("m_CSP_antibody") & individual.m_CSP_antibody;
// ----------------------------------------------------------------------
}