本文整理汇总了C++中yarp::os::ConnectionWriter::appendInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ ConnectionWriter::appendInt32方法的具体用法?C++ ConnectionWriter::appendInt32怎么用?C++ ConnectionWriter::appendInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yarp::os::ConnectionWriter
的用法示例。
在下文中一共展示了ConnectionWriter::appendInt32方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool MapGrid2D::write(yarp::os::ConnectionWriter& connection) const
{
connection.appendInt32(BOTTLE_TAG_LIST);
connection.appendInt32(9);
connection.appendInt32(BOTTLE_TAG_INT32);
connection.appendInt32(m_width);
connection.appendInt32(BOTTLE_TAG_INT32);
connection.appendInt32(m_height);
connection.appendInt32(BOTTLE_TAG_FLOAT64);
connection.appendFloat64(m_origin.x);
connection.appendInt32(BOTTLE_TAG_FLOAT64);
connection.appendFloat64(m_origin.y);
connection.appendInt32(BOTTLE_TAG_FLOAT64);
connection.appendFloat64(m_origin.theta);
connection.appendInt32(BOTTLE_TAG_FLOAT64);
connection.appendFloat64(m_resolution);
connection.appendInt32(BOTTLE_TAG_STRING);
connection.appendRawString(m_map_name.c_str());
unsigned char *mem = nullptr;
int memsize = 0;
mem = m_map_occupancy.getRawImage();
memsize = m_map_occupancy.getRawImageSize();
connection.appendInt32(BOTTLE_TAG_BLOB);
connection.appendInt32(memsize);
connection.appendExternalBlock((char*)mem, memsize);
mem = m_map_flags.getRawImage();
memsize = m_map_flags.getRawImageSize();
connection.appendInt32(BOTTLE_TAG_BLOB);
connection.appendInt32(memsize);
connection.appendExternalBlock((char*)mem, memsize);
connection.convertTextMode();
return !connection.isError();
}