summaryrefslogtreecommitdiffstats
path: root/functor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Get an inventory property's valueMatthew Barth2018-10-231-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for inventory manager to retrieve a property's value that it hosts as input to condition tests. Utilizing a provided sdbusplus server binding member function to get a property from the inventory hosted interface, a property can be read from that interface within inventory manager. After the property is read, the condition test is performed and the resulting action(s) occur. The only currently supported condition test for using a property from within inventory manager is the `propertyIs` condition. This is an example of the expected generated source to get a property from within inventory manager: make_filter(functor::propertyIs( "/system/chassis", "xyz.openbmc_project.Inventory.Decorator.CoolingType", "WaterCooled", true, "xyz.openbmc_project.Inventory.Manager", make_get_property<sdbusplus::xyz::openbmc_project::Inventory:: Decorator::server::CoolingType::PropertiesVariant> ( functor::getProperty<sdbusplus::xyz::openbmc_project:: Inventory::Decorator::server::CoolingType> ( "/system/chassis", "xyz.openbmc_project.Inventory.Decorator.CoolingType", &sdbusplus::xyz::openbmc_project::Inventory:: Decorator::server::CoolingType::getPropertyByName, "WaterCooled" ) ) )) Tested: Manually edited generated code to use property within inventory and actions occurred when condition passed Manually edited generated code to use property within inventory and actions did not run when condition failed Actions not run when get property function omitted Change-Id: I094bbacbcdeb239d33cac343b2daeb5f86e0a58a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* formatter: update clang-format and fix-up file(s)Patrick Venture2018-10-141-0/+1
| | | | | | | | clang-format-6.0 introduced new changes, also then updates to .clang-format introduce more new changes. Change-Id: Iec9f84e3a7a5bf254d66eee46cdc9b3070e06687 Signed-off-by: Patrick Venture <venture@google.com>
* Enable clang-formatBrad Bishop2018-03-291-16/+9
| | | | | | | Fix up problems and enable clang-format during CI builds. Change-Id: Ia5c88281f7090c0aa09ba586d968f1fcd8aba4f1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Move object_mapper per dbus path conventions.Leonel Gonzalez2017-03-201-1/+1
| | | | | | | Partial fix for openbmc/openbmc#1112. Change-Id: I628bdf7847f0eeb852fe12ec8d0fbadc8fd3eb68 Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* functor: remove unnecessary iterator comparisonPatrick Williams2017-03-091-1/+1
| | | | | Change-Id: If21765193d26a6908c4a85cbbc23da7d54acb222 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Add path conditionsBrad Bishop2017-02-151-3/+11
| | | | | | | | | Add support to setProperty and destroyObject to conditionally perform their action based on the result of a condition testing functor. Change-Id: I67ded31f4a7ee0f7a29bb6edc06ebf9249cdc070 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Merge actions.hpp and events.hppBrad Bishop2017-02-151-0/+93
Move all action/filter functors to a common functor.hpp. The intent of this refactoring is to facilitate reuse of functors in more than one context. - Moved functors from actions.hpp and events.hpp to functor.hpp. - Renamed events.cpp to functor.cpp. - Moved Action/Filter types to types.hpp. - Minor namespace shuffling. - Update pimgen to render according to the new namespaces. Change-Id: I630ec1587b8a48f6dc2eac1111365035873310d9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud