所使用的数据结构与同步方式读取所有property基本相同,只是方法不同:
//async_allprop.cpp
#include <iostream>
#include <boost/asio.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/asio/connection.hpp>
#include <sdbusplus/asio/object_server.hpp>
#include <sdbusplus/asio/property.hpp>
#include <sdbusplus/unpack_properties.hpp>
using namespace std;
using namespace sdbusplus;
void doAsyncGetAllProperty(sdbusplus::asio::connection& conn)
{
sdbusplus::asio::getAllProperties(
conn, "calculate.service", "/calculate_obj","calculate_infterface.data",
[](const boost::system::error_code& ec, vector<pair<string, variant<int, string>&