本文整理汇总了C++中BOOST_SERIALIZATION_NVP函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOST_SERIALIZATION_NVP函数的具体用法?C++ BOOST_SERIALIZATION_NVP怎么用?C++ BOOST_SERIALIZATION_NVP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BOOST_SERIALIZATION_NVP函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: BOOST_SERIALIZATION_NVP
void GalaxySetupData::serialize(Archive& ar, const unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(m_seed)
& BOOST_SERIALIZATION_NVP(m_size)
& BOOST_SERIALIZATION_NVP(m_shape)
& BOOST_SERIALIZATION_NVP(m_age)
& BOOST_SERIALIZATION_NVP(m_starlane_freq)
& BOOST_SERIALIZATION_NVP(m_planet_density)
& BOOST_SERIALIZATION_NVP(m_specials_freq)
& BOOST_SERIALIZATION_NVP(m_monster_freq)
& BOOST_SERIALIZATION_NVP(m_native_freq)
& BOOST_SERIALIZATION_NVP(m_ai_aggr);
if (version >= 1) {
ar & BOOST_SERIALIZATION_NVP(m_game_rules);
}
if (version >= 2) {
ar & BOOST_SERIALIZATION_NVP(m_game_uid);
} else {
if (Archive::is_loading::value) {
m_game_uid = boost::uuids::to_string(boost::uuids::random_generator()());
}
}
}
开发者ID:adrianbroher,项目名称:freeorion,代码行数:25,代码来源:SerializeMultiplayerCommon.cpp
示例2: serialize
void
SimplexWithVertices<V>::
serialize(Archive& ar, version_type )
{ ar & BOOST_SERIALIZATION_NVP(vertices_); }
开发者ID:veldanie,项目名称:Dionysus-python3,代码行数:4,代码来源:simplex.hpp
示例3: operator
void operator()(T const & value) const
{
m_ar << BOOST_SERIALIZATION_NVP(value);
}
开发者ID:Skovpin,项目名称:CodeBlocks-RG,代码行数:4,代码来源:variant.hpp
示例4: load_derived
void load_derived(const char *testfile)
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is);
polymorphic_derived1 *rd1 = NULL;
polymorphic_derived2 *rd2 = NULL;
std::cout << "loading polymorphic_derived1 (no_rtti)\n";
ia >> BOOST_SERIALIZATION_NVP(rd1);
BOOST_CHECK_MESSAGE(
boost::serialization::type_info_implementation<
polymorphic_derived1
>::type::get_const_instance()
==
* boost::serialization::type_info_implementation<
polymorphic_derived1
>::type::get_const_instance().get_derived_extended_type_info(*rd1)
,
"restored pointer d1 not of correct type"
);
std::cout << "loading polymorphic_derived2\n";
ia >> BOOST_SERIALIZATION_NVP(rd2);
BOOST_CHECK_MESSAGE(
boost::serialization::type_info_implementation<
polymorphic_derived2
>::type::get_const_instance()
==
* boost::serialization::type_info_implementation<
polymorphic_derived2
>::type::get_const_instance().get_derived_extended_type_info(*rd2)
,
"restored pointer d2 not of correct type"
);
polymorphic_base *rb1 = NULL;
polymorphic_base *rb2 = NULL;
// the above opereration registers the derived classes as a side
// effect. Hence, instances can now be correctly serialized through
// a base class pointer.
std::cout << "loading polymorphic_derived1 (no_rtti) through base (no_rtti)\n";
ia >> BOOST_SERIALIZATION_NVP(rb1);
BOOST_CHECK_MESSAGE(
rb1 == dynamic_cast<polymorphic_base *>(rd1),
"serialized pointers not correctly restored"
);
BOOST_CHECK_MESSAGE(
boost::serialization::type_info_implementation<
polymorphic_derived1
>::type::get_const_instance()
==
* boost::serialization::type_info_implementation<
polymorphic_base
>::type::get_const_instance().get_derived_extended_type_info(*rb1)
,
"restored pointer b1 not of correct type"
);
std::cout << "loading polymorphic_derived2 through base (no_rtti)\n";
ia >> BOOST_SERIALIZATION_NVP(rb2);
BOOST_CHECK_MESSAGE(
rb2 == dynamic_cast<polymorphic_base *>(rd2),
"serialized pointers not correctly restored"
);
BOOST_CHECK_MESSAGE(
boost::serialization::type_info_implementation<
polymorphic_derived2
>::type::get_const_instance()
==
* boost::serialization::type_info_implementation<
polymorphic_base
>::type::get_const_instance().get_derived_extended_type_info(*rb2)
,
"restored pointer b2 not of correct type"
);
delete rb1;
delete rb2;
}
开发者ID:PandaPYH,项目名称:boost-svn,代码行数:81,代码来源:test_no_rtti.cpp
示例5: serialize
void serialize( Archive & ar, const unsigned int version )
{
ar & BOOST_SERIALIZATION_NVP(m_type);
ar & BOOST_SERIALIZATION_NVP(m_seq);
ar & BOOST_SERIALIZATION_NVP(m_group);
ar & BOOST_SERIALIZATION_NVP(m_source);
ar & BOOST_SERIALIZATION_NVP(m_hostname);
ar & BOOST_SERIALIZATION_NVP(m_ResponseType);
ar & BOOST_SERIALIZATION_NVP(m_Response);
ar & BOOST_SERIALIZATION_NVP(cmd_);
ar & BOOST_SERIALIZATION_NVP(path_from_);
ar & BOOST_SERIALIZATION_NVP(path_to_);
ar & BOOST_SERIALIZATION_NVP(mode_);
};
开发者ID:ailidani,项目名称:dfs,代码行数:15,代码来源:message.hpp
示例6: serialize
template<class ArchiveT> void serialize(ArchiveT & ar, unsigned int version){ ar & BOOST_SERIALIZATION_NVP(contact); ar & BOOST_SERIALIZATION_NVP(force); }
开发者ID:Azeko2xo,项目名称:woodem,代码行数:1,代码来源:ContactContainer.hpp
示例7: serialize
void serialize(Archive &ar, const unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(data_ptr);
}
开发者ID:annaborn,项目名称:slam-envire_maps,代码行数:4,代码来源:LocalMap.hpp
示例8: BOOST_SERIALIZATION_BASE_OBJECT_NVP
void WeaponFireEvent::serialize(Archive& ar, const unsigned int version) {
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(CombatEvent);
ar & BOOST_SERIALIZATION_NVP(bout)
& BOOST_SERIALIZATION_NVP(round)
& BOOST_SERIALIZATION_NVP(attacker_id)
& BOOST_SERIALIZATION_NVP(target_id)
& BOOST_SERIALIZATION_NVP(weapon_name)
& BOOST_SERIALIZATION_NVP(power)
& BOOST_SERIALIZATION_NVP(shield)
& BOOST_SERIALIZATION_NVP(damage)
& BOOST_SERIALIZATION_NVP(target_owner_id)
& BOOST_SERIALIZATION_NVP(attacker_owner_id);
if (version < 3) {
int target_destroyed = 0;
ar & BOOST_SERIALIZATION_NVP (target_destroyed);
}
}
开发者ID:Mitten-O,项目名称:freeorion,代码行数:18,代码来源:CombatEvents.cpp
示例9: serialize
void serialize(Archive & ar, cv::Point2f & p, const unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(p.x);
ar & BOOST_SERIALIZATION_NVP(p.y);
}
开发者ID:gehrinch,项目名称:Schweizer-Messer,代码行数:5,代码来源:serialization.hpp
示例10: BOOST_SERIALIZATION_NVP
// so use this
void data::serialize(boost::archive::polymorphic_oarchive & ar, const unsigned int /* file_version */){
ar & BOOST_SERIALIZATION_NVP(a);
}
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:4,代码来源:test_polymorphic_A.cpp
示例11: BOOST_SERIALIZATION_BASE_OBJECT_NVP
void BoutBeginEvent::serialize ( Archive& ar, const unsigned int version ) {
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(CombatEvent);
ar & BOOST_SERIALIZATION_NVP ( bout );
}
开发者ID:Deepsloth,项目名称:freeorion,代码行数:4,代码来源:CombatEvents.cpp
示例12: serialize
void serialize(
Archive &ar,
const unsigned int /* file_version */
){
ar & BOOST_SERIALIZATION_NVP(b);
#ifndef BOOST_NO_INT64_T
ar & BOOST_SERIALIZATION_NVP(f);
ar & BOOST_SERIALIZATION_NVP(g);
#endif
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
int i;
if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){
i = l;
ar & BOOST_SERIALIZATION_NVP(i);
}
else{
ar & BOOST_SERIALIZATION_NVP(i);
l = i;
}
#else
ar & BOOST_SERIALIZATION_NVP(l);
#endif
ar & BOOST_SERIALIZATION_NVP(m);
ar & BOOST_SERIALIZATION_NVP(n);
ar & BOOST_SERIALIZATION_NVP(o);
ar & BOOST_SERIALIZATION_NVP(p);
ar & BOOST_SERIALIZATION_NVP(q);
#ifndef BOOST_NO_CWCHAR
ar & BOOST_SERIALIZATION_NVP(r);
#endif
ar & BOOST_SERIALIZATION_NVP(c);
ar & BOOST_SERIALIZATION_NVP(s);
ar & BOOST_SERIALIZATION_NVP(t);
ar & BOOST_SERIALIZATION_NVP(u);
ar & BOOST_SERIALIZATION_NVP(v);
ar & BOOST_SERIALIZATION_NVP(w);
ar & BOOST_SERIALIZATION_NVP(x);
ar & BOOST_SERIALIZATION_NVP(y);
#ifndef BOOST_NO_STD_WSTRING
ar & BOOST_SERIALIZATION_NVP(z);
#endif
}
开发者ID:LancelotGHX,项目名称:Simula,代码行数:42,代码来源:A.hpp
示例13: BOOST_SERIALIZATION_NVP
void A::serialize(
boost::archive::polymorphic_iarchive &ar,
const unsigned int /*version*/
){
ar & BOOST_SERIALIZATION_NVP(i);
}
开发者ID:pathscale,项目名称:boost-testsuite,代码行数:6,代码来源:test_polymorphic2imp.cpp
示例14: BOOST_SERIALIZATION_NVP
void FullPreview::serialize(Archive& ar, unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(filename)
& BOOST_SERIALIZATION_NVP(preview)
& BOOST_SERIALIZATION_NVP(galaxy);
}
开发者ID:amireldor,项目名称:freeorion,代码行数:6,代码来源:SaveGamePreviewUtils.cpp
示例15: BOOST_SERIALIZATION_NVP
void EnemyCheck::serialize(Archive& ar, const unsigned int version) {
ar & BOOST_SERIALIZATION_NVP(weight);
}
开发者ID:hahahahaman,项目名称:keeperrl,代码行数:3,代码来源:enemy_check.cpp
示例16: serialize
void serialize(Archive& ar, const unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(_archive);
ar & BOOST_SERIALIZATION_NVP(_xs);
ar & BOOST_SERIALIZATION_NVP(_ys);
}
开发者ID:Beerkay,项目名称:fooling,代码行数:6,代码来源:stat_map_image.hpp
示例17: BOOST_SERIALIZATION_NVP
template<> void
MappedDataFrame::serialize( boost::archive::xml_wiarchive& ar, const unsigned int version )
{
ar & BOOST_SERIALIZATION_NVP(data_);
}
开发者ID:qtplatz,项目名称:qtplatz,代码行数:5,代码来源:mappeddataframe.cpp
示例18: save
void save(Archive & ar, const unsigned int /* file_version */) const {
ar << BOOST_SERIALIZATION_NVP(x);
}
开发者ID:LancelotGHX,项目名称:Simula,代码行数:3,代码来源:test_shared_ptr_132.cpp
示例19: serialize
template<class Archive> void serialize(Archive& ar, const unsigned int version) {
(void)version;
ar & BOOST_SERIALIZATION_NVP(samplingInterval_)
& BOOST_SERIALIZATION_NVP(isConstantSampling_)
& BOOST_SERIALIZATION_NVP(timeRange_.first)
& BOOST_SERIALIZATION_NVP(timeRange_.second)
& BOOST_SERIALIZATION_NVP(dataDelayPoints_)
& BOOST_SERIALIZATION_NVP(descriptions_)
& BOOST_SERIALIZATION_NVP(axisLabelHorizontal_)
& BOOST_SERIALIZATION_NVP(axisLabelVertical_)
& BOOST_SERIALIZATION_NVP(dataArray_)
& BOOST_SERIALIZATION_NVP(timeArray_)
& BOOST_SERIALIZATION_NVP(evntVec_)
& BOOST_SERIALIZATION_NVP(peaks_)
;
}
开发者ID:HiroyukiSeki,项目名称:qtplatz,代码行数:16,代码来源:chromatogram.cpp
示例20: out
unsigned int GSMS::Source::save(std::ofstream* stream)
{
Source* pSource = this;
boost::archive::xml_oarchive out(*stream);
out << BOOST_SERIALIZATION_NVP(pSource);
}
开发者ID:Aequilibrium,项目名称:GSMS,代码行数:6,代码来源:Source.cpp
注:本文中的BOOST_SERIALIZATION_NVP函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论