commit | 3306847106526b76af55513a0c1a5d974ede9c25 | [log] [tgz] |
---|---|---|
author | Brad Bishop <bradleyb@us.ibm.com> | Tue Jan 24 12:55:01 2017 -0500 |
committer | Patrick Williams <patrick@stwcx.xyz> | Mon Jan 30 15:28:39 2017 -0600 |
tree | 00c5a608fe95a35c4d4b1a86515c4bb0f9b72235 | |
parent | bc4afed4330dadec28b376b4e8e4784bdd7dcad7 [diff] |
Allow implicit string_wrapper conversions Add comparison operators to allow string_wrappers to be implicity converted to strings for comparisons to cut down on casting and/or str member access. Do not allow std::string to be impliclitly converted to object_path to avoid a temporary string copy. Change-Id: I2e45a4fc3ee07d1df55f6fab2cfa35da205c150e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
sdbusplus is a library and a tool for generating C++ bindings to dbus.
The path of your file will be the interface name. For example, for an interface xyz.openbmc_project.control.Chassis
, you would create the following file: xyz/openbmc_project/control/Chassis.interface.yaml
. Similary, for errors, you would create xyz/openbmc_project/control/Chassis.errors.yaml
.
Generating all the files:
root_dir=$(readlink -f ../phosphor-dbus-interfaces) desired_interface=xyz.openbmc_project.control.Chassis file_prefix=chassis_interface file_exp_prefix=chassis_interface_exceptions outdir=../phosphor-chassis-control/generated # Server bindings python tools/sdbus++ --templatedir=tools/sdbusplus/templates --rootdir=$root_dir interface server-header $desired_interface > $outdir/$file_prefix.hpp python tools/sdbus++ --templatedir=tools/sdbusplus/templates --rootdir=$root_dir interface server-cpp $desired_interface > $outdir/$file_prefix.cpp # Exception bindings python tools/sdbus++ --templatedir=tools/sdbusplus/templates --rootdir=$root_dir error exception-header $desired_interface > $outdir/$file_exp_prefix.hpp python tools/sdbus++ --templatedir=tools/sdbusplus/templates --rootdir=$root_dir error exception-cpp $desired_interface > $outdir/$file_exp_prefix.cpp # Docs python tools/sdbus++ --templatedir=tools/sdbusplus/templates --rootdir=$root_dir interface markdown $desired_interface > $outdir/$file_prefix.md python tools/sdbus++ --templatedir=tools/sdbusplus/templates --rootdir=$root_dir error markdown $desired_interface > $outdir/$file_exp_prefix.md