~thomas-voss/dbus-cpp/force_gcc_4.7_and_symbols

« back to all changes in this revision

Viewing changes to src/core/dbus/match_rule.cpp

  • Committer: Tarmac
  • Author(s): Pete Woods
  • Date: 2014-02-03 12:21:44 UTC
  • mfrom: (24.3.36 trunk)
  • Revision ID: tarmac-20140203122144-u15nf8142o7cplj3
Add service watcher class to allow watching DBus name ownership changes.

Approved by PS Jenkins bot, Thomas Voß.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    std::string interface;
52
52
    std::string member;
53
53
    types::ObjectPath path;
 
54
    dbus::MatchRule::MatchArgs args;
54
55
};
55
56
 
56
57
dbus::MatchRule::MatchRule() : d(new Private())
136
137
    return result.path(p);
137
138
}
138
139
 
 
140
dbus::MatchRule& dbus::MatchRule::args(const MatchArgs& p)
 
141
{
 
142
    d->args = p;
 
143
    return *this;
 
144
}
 
145
 
 
146
dbus::MatchRule& dbus::MatchRule::args(const MatchArgs& p) const
 
147
{
 
148
    MatchRule result {*this};
 
149
    return result.args(p);
 
150
}
 
151
 
139
152
std::string dbus::MatchRule::as_string() const
140
153
{
141
154
    static const std::map<Message::Type, std::string> lut =
157
170
        ss << comma << "member='" << d->member << "'" << comma;
158
171
    if (!d->path.empty())
159
172
        ss << comma << "path='" << d->path.as_string() << "'" << comma;
 
173
    for(const MatchArg& arg: d->args) {
 
174
        ss << comma << "arg" << arg.first << "='" << arg.second << "'" << comma;
 
175
    }
160
176
 
161
177
    return ss.str();
162
178
}