sdbusplus:根据条件过滤signal

sdbusplus提供了方法可以根据条件过滤signal:

//server_send_signal.cpp

#include 
#include 
#include 
#include 
#include 
 
using namespace std;
 
shared_ptr  bus;
 
int addInt(int d1, int d2)
{
    return d1 + d2;
}
 
string addString(string s1, string s2)
{
    string res = s1 + s2;
    sdbusplus::message_t m = bus->new_signal("/calculate_obj","calculate_infterface.data", "MethodCallAddString");
    m.append(s1, s2); 
    m.append(res);
    m.signal_send();

    return res;
}
 
int main()
{
    boost::asio::io_context io;
    auto conn = std::make_shared(io);
    bus = conn;
    conn->request_name("calculate.service");
    auto server = sdbusplus::asio::object_server(conn);
    shared_ptr&l

你可能感兴趣的:(#,sdbusplus,linux)