本文整理汇总了C++中yarp::os::ConnectionWriter::appendString方法的典型用法代码示例。如果您正苦于以下问题:C++ ConnectionWriter::appendString方法的具体用法?C++ ConnectionWriter::appendString怎么用?C++ ConnectionWriter::appendString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yarp::os::ConnectionWriter
的用法示例。
在下文中一共展示了ConnectionWriter::appendString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
bool SystemInfoSerializer::write(yarp::os::ConnectionWriter& connection)
{
// updating system info
memory = SystemInfo::getMemoryInfo();
storage = SystemInfo::getStorageInfo();
//network = SystemInfo::getNetworkInfo();
processor = SystemInfo::getProcessorInfo();
platform = SystemInfo::getPlatformInfo();
load = SystemInfo::getLoadInfo();
user = SystemInfo::getUserInfo();
// serializing memory
connection.appendInt(memory.totalSpace);
connection.appendInt(memory.freeSpace);
// serializing storage
connection.appendInt(storage.totalSpace);
connection.appendInt(storage.freeSpace);
// serializing network
//connection.appendString(network.mac.c_str());
//connection.appendString(network.ip4.c_str());
//connection.appendString(network.ip6.c_str());
// serializing processor
connection.appendString(processor.architecture.c_str());
connection.appendString(processor.model.c_str());
connection.appendString(processor.vendor.c_str());
connection.appendInt(processor.family);
connection.appendInt(processor.modelNumber);
connection.appendInt(processor.cores);
connection.appendInt(processor.siblings);
connection.appendDouble(processor.frequency);
// serializing load
connection.appendDouble(load.cpuLoad1);
connection.appendDouble(load.cpuLoad5);
connection.appendDouble(load.cpuLoad15);
connection.appendInt(load.cpuLoadInstant);
// serializing platform
connection.appendString(platform.name.c_str());
connection.appendString(platform.distribution.c_str());
connection.appendString(platform.release.c_str());
connection.appendString(platform.codename.c_str());
connection.appendString(platform.kernel.c_str());
connection.appendString(platform.environmentVars.toString().c_str());
// serializing user
connection.appendString(user.userName.c_str());
connection.appendString(user.realName.c_str());
connection.appendString(user.homeDir.c_str());
connection.appendInt(user.userID);
return !connection.isError();
}