| #ifndef PAYLOAD_PROPERTIES_HANDLER_ACTION_H_ |
| #define PAYLOAD_PROPERTIES_HANDLER_ACTION_H_ |
| |
| #include "update_engine/common/action.h" |
| #include "update_engine/system_state.h" |
| #include "update_engine/payload_consumer/install_plan.h" |
| #include "update_engine/payload_properties.h" |
| |
| // This class reads in Payload properties and converts what it sees into |
| // an install plan which is passed out. |
| |
| namespace chromeos_update_engine { |
| |
| class PayloadPropertiesHandlerAction; |
| |
| template<> |
| class ActionTraits<PayloadPropertiesHandlerAction> { |
| public: |
| // Takes parameters on the input pipe. |
| typedef PayloadProperties InputObjectType; |
| typedef InstallPlan OutputObjectType; |
| }; |
| |
| class PayloadPropertiesHandlerAction : public Action<PayloadPropertiesHandlerAction> |
| { |
| public: |
| |
| PayloadPropertiesHandlerAction(SystemState* system_state); |
| ~PayloadPropertiesHandlerAction() override; |
| |
| typedef ActionTraits<PayloadPropertiesHandlerAction>::InputObjectType InputObjectType; |
| typedef ActionTraits<PayloadPropertiesHandlerAction>::OutputObjectType OutputObjectType; |
| |
| void PerformAction() override; |
| |
| const InstallPlan& install_plan() const { return install_plan_; } |
| |
| // Debugging/logging |
| static std::string StaticType() { return "PayloadPropertiesHandlerAction"; } |
| std::string Type() const override { return StaticType(); } |
| |
| private: |
| |
| // Global system context. |
| SystemState* system_state_; |
| |
| // The install plan, if we have an update. |
| InstallPlan install_plan_; |
| |
| DISALLOW_COPY_AND_ASSIGN(PayloadPropertiesHandlerAction); |
| }; |
| |
| } // namespace chromeos_update_engine |
| |
| #endif // PAYLOAD_PROPERTIES_HANDLER_ACTION_H_ |