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


C++ packer::pack方法代码示例

本文整理汇总了C++中msgpack::packer::pack方法的典型用法代码示例。如果您正苦于以下问题:C++ packer::pack方法的具体用法?C++ packer::pack怎么用?C++ packer::pack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在msgpack::packer的用法示例。


在下文中一共展示了packer::pack方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pack

void compressive_storage::pack(
    msgpack::packer<msgpack::sbuffer>& packer) const {
  packer.pack_array(4);
  packer.pack(static_cast<const storage&>(*this));
  packer.pack(mine_);
  packer.pack(status_);
  packer.pack(*compressor_);
}
开发者ID:pombredanne,项目名称:jubatus,代码行数:8,代码来源:compressive_storage.cpp

示例2: msgpack_pack

void ContentFeatures::msgpack_pack(msgpack::packer<msgpack::sbuffer> &pk) const
{
	pk.pack_map(38);
	PACK(CONTENTFEATURES_NAME, name);
	PACK(CONTENTFEATURES_GROUPS, groups);
	PACK(CONTENTFEATURES_DRAWTYPE, (int)drawtype);
	PACK(CONTENTFEATURES_VISUAL_SCALE, visual_scale);

	pk.pack((int)CONTENTFEATURES_TILEDEF);
	pk.pack_array(6);
	for (size_t i = 0; i < 6; ++i)
		pk.pack(tiledef[i]);

	pk.pack((int)CONTENTFEATURES_TILEDEF_SPECIAL);
	pk.pack_array(CF_SPECIAL_COUNT);
	for (size_t i = 0; i < CF_SPECIAL_COUNT; ++i)
		pk.pack(tiledef_special[i]);

	PACK(CONTENTFEATURES_ALPHA, alpha);
	PACK(CONTENTFEATURES_POST_EFFECT_COLOR, post_effect_color);
	PACK(CONTENTFEATURES_PARAM_TYPE, (int)param_type);
	PACK(CONTENTFEATURES_PARAM_TYPE_2, (int)param_type_2);
	PACK(CONTENTFEATURES_IS_GROUND_CONTENT, is_ground_content);
	PACK(CONTENTFEATURES_LIGHT_PROPAGATES, light_propagates);
	PACK(CONTENTFEATURES_SUNLIGHT_PROPAGATES, sunlight_propagates);
	PACK(CONTENTFEATURES_WALKABLE, walkable);
	PACK(CONTENTFEATURES_POINTABLE, pointable);
	PACK(CONTENTFEATURES_DIGGABLE, diggable);
	PACK(CONTENTFEATURES_CLIMBABLE, climbable);
	PACK(CONTENTFEATURES_BUILDABLE_TO, buildable_to);
	PACK(CONTENTFEATURES_LIQUID_TYPE, (int)liquid_type);
	PACK(CONTENTFEATURES_LIQUID_ALTERNATIVE_FLOWING, liquid_alternative_flowing);
	PACK(CONTENTFEATURES_LIQUID_ALTERNATIVE_SOURCE, liquid_alternative_source);
	PACK(CONTENTFEATURES_LIQUID_VISCOSITY, liquid_viscosity);
	PACK(CONTENTFEATURES_LIQUID_RENEWABLE, liquid_renewable);
	PACK(CONTENTFEATURES_LIGHT_SOURCE, light_source);
	PACK(CONTENTFEATURES_DAMAGE_PER_SECOND, damage_per_second);
	PACK(CONTENTFEATURES_NODE_BOX, node_box);
	PACK(CONTENTFEATURES_SELECTION_BOX, selection_box);
	PACK(CONTENTFEATURES_LEGACY_FACEDIR_SIMPLE, legacy_facedir_simple);
	PACK(CONTENTFEATURES_LEGACY_WALLMOUNTED, legacy_wallmounted);
	PACK(CONTENTFEATURES_SOUND_FOOTSTEP, sound_footstep);
	PACK(CONTENTFEATURES_SOUND_DIG, sound_dig);
	PACK(CONTENTFEATURES_SOUND_DUG, sound_dug);
	PACK(CONTENTFEATURES_RIGHTCLICKABLE, rightclickable);
	PACK(CONTENTFEATURES_DROWNING, drowning);
	PACK(CONTENTFEATURES_LEVELED, leveled);
	PACK(CONTENTFEATURES_WAVING, waving);
	PACK(CONTENTFEATURES_MESH, mesh);
	PACK(CONTENTFEATURES_COLLISION_BOX, collision_box);
}
开发者ID:cyisfor,项目名称:freeminer,代码行数:51,代码来源:nodedef.cpp

示例3: msgpack_pack

void Settings::msgpack_pack(msgpack::packer<msgpack::sbuffer> &pk) const
{
	Json::Value json;
	toJson(json);
	std::ostringstream os(std::ios_base::binary);
	os << json;
	pk.pack(os.str());
}
开发者ID:Falcon-peregrinus,项目名称:freeminer,代码行数:8,代码来源:settings.cpp

示例4: save

void Chunk::save(msgpack::packer<Poco::DeflatingOutputStream>& o) const
{
	const bool has_meshes = false;
	uint32_t array_size = 3;
	if(has_meshes) array_size += 1;

	o.pack_array(array_size);
	const bool is_solid = this->solid_block != nullptr;
	o.pack(is_solid);
	if(is_solid)
	{
		o.pack(this->solid_block);
	}
	else
	{
		o.pack(this->blocks);
	}

	o.pack(has_meshes);
	if(has_meshes)
	{
		o.pack(this->get_meshes());
	}
}
开发者ID:MrMetric,项目名称:block_thingy,代码行数:24,代码来源:Chunk.hpp

示例5: msgpack_pack

 void msgpack_pack(msgpack::packer<Buffer>& packer) const {
   packer.pack_array(2);
   packer.pack(static_cast<uint8_t>(type_));
   packer.pack(static_cast<uint64_t>(bit_vector_length_));
 }
开发者ID:AutonomicSecurity,项目名称:jubatus,代码行数:5,代码来源:column_type.hpp

示例6:

void	Server::Unit::serialize(msgpack::packer<msgpack::sbuffer>& packet) const
{
  packet.pack(_data);
  packet.pack(this->getPhysics());
}
开发者ID:Vrixyz,项目名称:CodeA,代码行数:5,代码来源:Unit.cpp

示例7: pack

 static void pack (
     msgpack::packer<Stream>& o,
     const Tuple& v) {
     o.pack(std::get<0>(v));
 }
开发者ID:1234224576,项目名称:ProfileMaker,代码行数:5,代码来源:tuple.hpp

示例8: pack

void local_storage::pack(msgpack::packer<msgpack::sbuffer>& packer) const {
  packer.pack(*this);
}
开发者ID:AutonomicSecurity,项目名称:jubatus,代码行数:3,代码来源:local_storage.cpp

示例9: pack

void sparse_matrix_storage::pack(msgpack::packer<msgpack::sbuffer>& packer)
    const {
  packer.pack(*this);
}
开发者ID:AutonomicSecurity,项目名称:jubatus,代码行数:4,代码来源:sparse_matrix_storage.cpp

示例10: pack

 void pack(msgpack::packer<Buffer>& packer) const {
   packer.pack(*this);
 }
开发者ID:pombredanne,项目名称:jubatus,代码行数:3,代码来源:lof_storage.hpp

示例11: pack

void inverted_index_storage::pack(
    msgpack::packer<msgpack::sbuffer>& packer) const {
  packer.pack(*this);
}
开发者ID:AutonomicSecurity,项目名称:jubatus,代码行数:4,代码来源:inverted_index_storage.cpp

示例12: pack

void simple_storage::pack(msgpack::packer<msgpack::sbuffer>& packer) const {
  packer.pack_array(2);
  packer.pack(static_cast<const storage&>(*this));
  packer.pack(mine_);
}
开发者ID:pombredanne,项目名称:jubatus,代码行数:5,代码来源:simple_storage.cpp

示例13: pack

void recommender_mock_storage::pack(
    msgpack::packer<msgpack::sbuffer>& packer) const {
  packer.pack(*this);
}
开发者ID:AutonomicSecurity,项目名称:jubatus,代码行数:4,代码来源:recommender_mock_storage.cpp


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