summaryrefslogtreecommitdiffstats
path: root/dbus/property.h
Commit message (Collapse)AuthorAgeFilesLines
* READABILITY for Keybukkeybuk@chromium.org2012-03-221-20/+25
| | | | | | | | | | | | BUG=none TEST=dbus_unittests & emerge chromeos-chrome change-Id: I111b9e60a2c6c35edd9e0ea9f6976928c6c6474b Review URL: http://codereview.chromium.org/9407019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128286 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: clear array values before reading from variantkeybuk@google.com2012-03-211-3/+4
| | | | | | | | | | | | | | | | | | PopArrayFromVariant() appends values to the existing value, rather than clearing first like I expected, so using this without clear() first means the property value accumulates all values and never loses them. BUG=none TEST=unit test included Change-Id: Ie392a89190f4ad8570a905f24b2f446e1f2bed81 R=satorux@chromium.org Review URL: https://chromiumcodereview.appspot.com/9809001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128108 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: slight cleanup to Property codekeybuk@chromium.org2012-02-171-15/+11
| | | | | | | | | | | | | | | | | | | | | Correct comments based on practice that worked best for the bluetooth adapter and device clients, in particular adding the virtual destructor to the struct and cleaning up the return values of GetObject() in the documentation. Drop VLOG() calls, there's no need to debug at this level, you can use dbus-monitor to see the incoming and outgoing calls to Chromium and can add logging in upper layers when there are real values to log. BUG=none TEST=built on try bots Change-Id: I2ac6b55e288626b5f9cd843935887e261d386dec Review URL: http://codereview.chromium.org/9418035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122522 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Property<>.value() should be constkeybuk@chromium.org2012-02-171-1/+1
| | | | | | | | | | | | | | | Constant references to PropertySets are a useful way to avoid someone calling Get() and Set(), but we should allow them to call value(). BUG=none TEST=built and tested Change-Id: Ic8e5449e87ba3cebbe6a3534596bb53016236333 Review URL: http://codereview.chromium.org/9414029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122467 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: ProperySet destructor must be virtualkeybuk@chromium.org2012-02-171-1/+1
| | | | | | | | | | | | | | | clang requires us to have a destructor for this "complex" class, but that destructor will need to be virtual later. BUG=none TEST=git try -b linux_chromeos_clang Change-Id: Ia0efd34f205ab090cd7f2092d47fc0288b1f4e0c Review URL: http://codereview.chromium.org/9420027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122417 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add Property handling for clientskeybuk@chromium.org2012-02-151-0/+421
D-Bus properties can be tricky to handle due to their reliance on variants, and since they use a common interface, result in a lot of copy and paste code to deal with. Add an API that simplifies matters somewhat; detailed documentation is in dbus/property.h, but fundamentally you add a struct Properties to the client implementation derived from dbus::PropertySet, and in it declare members of dbus::Property<property type> and connect them in the constructor with RegisterProperty(name, ptr). The API works on two levels, from a higher-level each member of the structure is a type-safe way to obtain the current value of the property, update the value, and set a new value. From the lower-level, it uses a generic reader/writer based interface so that the parent structure's GetAll and signal handling methods can update the values without requiring knowledge of the contained type. BUG=chromium:109194 TEST=unit tests included in CL change-Id: I111b9e60a2c6c35edd9e0ea9f6976928c6c6474b Review URL: http://codereview.chromium.org/9380053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122039 0039d316-1c4b-4281-b951-d872f2087c98