当前位置: 首页>>代码示例>>C++>>正文


C++ IArchive::startObject方法代码示例

本文整理汇总了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();
 }
开发者ID:Bridenbecker,项目名称:EMOD,代码行数:30,代码来源:IndividualMalaria.cpp

示例2: serialize

 void serialize(IArchive& ar, pfemp1_antibody_t& antibodies)
 {
     ar.startObject();
         ar.labelElement("minor") & antibodies.minor;
         ar.labelElement("major") & antibodies.major;
     ar.endObject();
 }
开发者ID:InstituteforDiseaseModeling,项目名称:EMOD,代码行数:7,代码来源:MalariaAntibody.cpp

示例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();
    }
开发者ID:clorton,项目名称:EMOD,代码行数:46,代码来源:VectorProbabilities.cpp


注:本文中的IArchive::startObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。