diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-05-22 23:23:13 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-05-23 18:56:43 -0400 |
commit | 870c3fc67cd66cfd90bf262433f5141e76fc2145 (patch) | |
tree | 776fb15ac1fbbf45dc61e0424ccb832c9ecda022 /src/generated.cpp | |
parent | e3a01af49b01b870dd7739bf60e7be4621754c5a (diff) | |
download | phosphor-dbus-monitor-870c3fc67cd66cfd90bf262433f5141e76fc2145.tar.gz phosphor-dbus-monitor-870c3fc67cd66cfd90bf262433f5141e76fc2145.zip |
build: General build refactoring
Add vars.mk for variable sharing across makefiles.
Stub and rename example YAML file and template.
Content to be re-introduced as support is added.
Move generated C++ to a header file.
Add input YAML path option to configure.
Change-Id: Ia06e392e8b120b1e1d8614046064fa432a6f9e18
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'src/generated.cpp')
-rw-r--r-- | src/generated.cpp | 184 |
1 files changed, 0 insertions, 184 deletions
diff --git a/src/generated.cpp b/src/generated.cpp deleted file mode 100644 index 6ef7cd1..0000000 --- a/src/generated.cpp +++ /dev/null @@ -1,184 +0,0 @@ -#include "data_types.hpp" -#include "functor.hpp" -#include "monitor.hpp" -#include "conditions.hpp" -#include "actions.hpp" - -namespace phosphor -{ -namespace dbus -{ -namespace monitoring -{ - -// Example vector of sensors constructing a group -static Group fan_zone_group = { - std::make_tuple( - "/xyz/openbmc_project/sensors/fan_tach/fan0", - static_cast<int64_t>(0) - ), - std::make_tuple( - "/xyz/openbmc_project/sensors/fan_tach/fan1", - static_cast<int64_t>(0) - ), - std::make_tuple( - "/xyz/openbmc_project/sensors/fan_tach/fan2", - static_cast<int64_t>(0) - ), - std::make_tuple( - "/xyz/openbmc_project/sensors/fan_tach/fan3", - static_cast<int64_t>(0) - ) -}; - -const std::vector<std::tuple<std::vector<std::shared_ptr<Event>>, - std::vector<Action>>> - Monitor::events -{ // Example vector of Events with START trigger - {std::make_tuple(std::vector<std::shared_ptr<Event>>( - { // Example vector of StartEvent - std::make_shared<StartEvent>( - std::vector<Condition>( - { // Example vector of StartEvent conditions - make_condition(propertyStart<int64_t>( - "/xyz/openbmc_project/sensors/fan_tach/fan0", - "xyz.openbmc_project.Sensor.Value", - "Value", - condition::countAtOrAbove( - fan_zone_group, - "/xyz/openbmc_project/sensors/fan_tach/fan0", - static_cast<size_t>(3), - static_cast<int64_t>(8000ll) - ) - )), - make_condition(propertyStart<int64_t>( - "/xyz/openbmc_project/sensors/fan_tach/fan1", - "xyz.openbmc_project.Sensor.Value", - "Value", - condition::countAtOrAbove( - fan_zone_group, - "/xyz/openbmc_project/sensors/fan_tach/fan1", - static_cast<size_t>(3), - static_cast<int64_t>(8000ll) - ) - )), - make_condition(propertyStart<int64_t>( - "/xyz/openbmc_project/sensors/fan_tach/fan2", - "xyz.openbmc_project.Sensor.Value", - "Value", - condition::countAtOrAbove( - fan_zone_group, - "/xyz/openbmc_project/sensors/fan_tach/fan2", - static_cast<size_t>(3), - static_cast<int64_t>(8000ll) - ) - )), - make_condition(propertyStart<int64_t>( - "/xyz/openbmc_project/sensors/fan_tach/fan3", - "xyz.openbmc_project.Sensor.Value", - "Value", - condition::countAtOrAbove( - fan_zone_group, - "/xyz/openbmc_project/sensors/fan_tach/fan3", - static_cast<size_t>(3), - static_cast<int64_t>(8000ll) - ) - )), - } - ) - ), - std::make_shared<SignalEvent>( - "interface='org.freedesktop.DBus.Properties'," - "member='PropertiesChanged'," - "type='signal'," - "path='/xyz/openbmc_project/sensors/fan_tach/fan0'", - std::vector<Condition>( - { // Example vector of SignalEvent conditions - make_condition(propertySignal<int64_t>( - "xyz.openbmc_project.Sensor.Value", - "Value", - condition::countAtOrAbove( - fan_zone_group, - "/xyz/openbmc_project/sensors/fan_tach/fan0", - static_cast<size_t>(3), - static_cast<int64_t>(8000ll) - ) - )) - } - ) - ), - std::make_shared<SignalEvent>( - "interface='org.freedesktop.DBus.Properties'," - "member='PropertiesChanged'," - "type='signal'," - "path='/xyz/openbmc_project/sensors/fan_tach/fan1'", - std::vector<Condition>( - { // Example vector of SignalEvent conditions - make_condition(propertySignal<int64_t>( - "xyz.openbmc_project.Sensor.Value", - "Value", - condition::countAtOrAbove( - fan_zone_group, - "/xyz/openbmc_project/sensors/fan_tach/fan1", - static_cast<size_t>(3), - static_cast<int64_t>(8000ll) - ) - )) - } - ) - ), - std::make_shared<SignalEvent>( - "interface='org.freedesktop.DBus.Properties'," - "member='PropertiesChanged'," - "type='signal'," - "path='/xyz/openbmc_project/sensors/fan_tach/fan2'", - std::vector<Condition>( - { // Example vector of SignalEvent conditions - make_condition(propertySignal<int64_t>( - "xyz.openbmc_project.Sensor.Value", - "Value", - condition::countAtOrAbove( - fan_zone_group, - "/xyz/openbmc_project/sensors/fan_tach/fan2", - static_cast<size_t>(3), - static_cast<int64_t>(8000ll) - ) - )) - } - ) - ), - std::make_shared<SignalEvent>( - "interface='org.freedesktop.DBus.Properties'," - "member='PropertiesChanged'," - "type='signal'," - "path='/xyz/openbmc_project/sensors/fan_tach/fan3'", - std::vector<Condition>( - { // Example vector of SignalEvent conditions - make_condition(propertySignal<int64_t>( - "xyz.openbmc_project.Sensor.Value", - "Value", - condition::countAtOrAbove( - fan_zone_group, - "/xyz/openbmc_project/sensors/fan_tach/fan3", - static_cast<size_t>(3), - static_cast<int64_t>(8000ll) - ) - )) - } - ) - ) - }), - std::vector<Action>( - { - make_action( - action::log_error( - "ERROR: Number of fans at or above 8000rpms reached" - ) - ) - }) - )} -}; - -} // namespace monitoring -} // namespace dbus -} // namespace phosphor |