summaryrefslogtreecommitdiffstats
path: root/src/propertywatchimpl.hpp
Commit message (Collapse)AuthorAgeFilesLines
* std::variant: Fixup .get() usageWilliam A. Kennington III2018-11-121-1/+1
| | | | | | | | | | | This is just a refactor from the mapbox specific .get() interface to the common std::variant ::get<>() interface. Tested: Built and run through unit tests. Change-Id: Ic0737f632e80c9dd5b73717ec33d31f245f107db Signed-off-by: William A. Kennington III <wak@google.com>
* update .clang-formatPatrick Venture2018-09-041-3/+4
| | | | | | | | Added the header inclusion order to the .clang-format file generated these changes. Change-Id: I4f51a20f469de431ee6a5ba78e3f4da39c980fab Signed-off-by: Patrick Venture <venture@google.com>
* propertywatch: Improve error handlingBrad Bishop2018-07-111-6/+26
| | | | | | | | | | | | | | | Handle exceptions from the sdbusplus method call API. A number of method calls are made at application startup. First the mapper is queried and then host services directly to obtain initial values for the property cache. In either case a missing object is sometimes expected and tolerated (in a logical sense) without issue. Eat the new exceptions in these scenarios and avoid a program crash. Change-Id: Id79d28b2da997f3c545b86c21932e271e3df8bb3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Enable clang-formatBrad Bishop2018-03-291-35/+20
| | | | | | | Fix up errors and enable clang-format during CI builds. Change-Id: I4176b81f8b85a287af9354165e09ff66aeb9fb29 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add constants for tuple fieldsMatt Spinler2018-02-271-1/+1
| | | | | | | | | Add constants for use with std::get. Tested: Run unit tests Change-Id: Ic09c13feeda69d61c98f63d227cae8f08d1bf50e Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Extend storage array to contain additional dataMatt Spinler2018-02-231-1/+2
| | | | | | | | | | | | | | | | | | | This array was originally just an array of objects of type 'any'. This commit changes it to be an array of tuples of type <any, any> to add an extra field for use by anything that needs it. For example, the storage is currently used to store property values, and a future change to the CountCondition class will now also store the result of the comparisons done between the property values and another value specified in the rule YAML. Then, a callback will be able to see the result of whether each property passed the check. Tested: Build and run unit tests Change-Id: I58f32c9f4068b15a02b1ff7f28871161cafebddb Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add callback contextsRatan Gupta2018-02-221-3/+3
| | | | | | | | | | | | | | | | | Add the notion of a callback context. This enables callbacks to have logic around the conditions they were invoked in. There are two context on which call back can be invoked 1) Startup: during startup all the call backs will be called 2) Signal: As part of condition match on the watched properties. Callback would behave differently based on the context. eg: eventCallback 1) Startup: Don't take any action. 2) Signal: Create the Dbus Object for the event. Change-Id: If455558798ac3e44bbd8a93de0ce1b09d2e308ae Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Add getBusName() utility function to SDBusPlusMatt Spinler2017-11-141-5/+0
| | | | | | | | Add a function to SDBusPlus to get the D-Bus bus name for an object path and interface. Change-Id: I7d7a533c7430fcf42e1e0f6a21a2453e6c8197ea Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* expose watch callbacksBrad Bishop2017-06-191-4/+11
| | | | | | | | | | | | Allow watch class users to explicitly invoke the watch callback. Since watches and callbacks share a common pool of state all watches must complete their initialization prior to invoking their callback methods. Change-Id: I62ebad64da88a145f3d5006b07c01381b0eb6728 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Link watches to callbacksBrad Bishop2017-06-191-0/+7
| | | | | | | | Callbacks must ultimately be triggered when a property is updated by a watch. Add that support. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I20130a11c19ddcf2c4ae45800f2068b31950bcd6
* Add support for callbacksBrad Bishop2017-06-191-4/+2
| | | | | | | | | Callbacks are the response in the PDM 'trigger->response' model. Add general support for implementing callbacks and implement a log to systemd journal using that framework. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I8bead5368ee5472a02b47e8bba9e9df3a1f346bc
* Add property watchesBrad Bishop2017-06-191-0/+183
Property watches cache DBus property values given an externally supplied index of property names and paths, in an externally supplied storage location. Change-Id: I155081da88c3ab0e4f6a13b012fc9719203b1888 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud