fw-update: Break circular dependency
```
In file included from ../pldmd/pldmd.cpp:2:
In file included from ../common/flight_recorder.hpp:3:
In file included from ../common/utils.hpp:15:
In file included from ../subprojects/nlohmann_json/single_include/nlohmann/json.hpp:29:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/memory:78:
/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'pldm::fw_update::Activation'
91 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:398:4: note: in instantiation of member function 'std::default_delete<pldm::fw_update::Activation>::opera
tor()' requested here
398 | get_deleter()(std::move(__ptr));
| ^
../fw-update/update_manager.hpp:46:14: note: in instantiation of member function 'std::unique_ptr<pldm::fw_update::Activation>::~unique_ptr' requested here
46 | explicit UpdateManager(
| ^
../fw-update/update_manager.hpp:33:7: note: forward declaration of 'pldm::fw_update::Activation'
33 | class Activation;
| ^
In file included from ../pldmd/pldmd.cpp:2:
In file included from ../common/flight_recorder.hpp:3:
In file included from ../common/utils.hpp:15:
In file included from ../subprojects/nlohmann_json/single_include/nlohmann/json.hpp:29:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/memory:78:
/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'pldm::fw_update::ActivationProgress'
91 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:398:4: note: in instantiation of member function 'std::default_delete<pldm::fw_update::ActivationProgress
>::operator()' requested here
398 | get_deleter()(std::move(__ptr));
| ^
../fw-update/update_manager.hpp:46:14: note: in instantiation of member function 'std::unique_ptr<pldm::fw_update::ActivationProgress>::~unique_ptr' requested here
46 | explicit UpdateManager(
| ^
../fw-update/update_manager.hpp:34:7: note: forward declaration of 'pldm::fw_update::ActivationProgress'
34 | class ActivationProgress;
| ^
```
Change-Id: I2820cbe134d1f37a43e6a5056eed87dde6e63b08
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/fw-update/activation.cpp b/fw-update/activation.cpp
new file mode 100644
index 0000000..d39cf9f
--- /dev/null
+++ b/fw-update/activation.cpp
@@ -0,0 +1,35 @@
+#include "fw-update/activation.hpp"
+
+#include "fw-update/update_manager.hpp"
+
+namespace pldm
+{
+namespace fw_update
+{
+
+ActivationIntf::Activations
+ Activation::activation(ActivationIntf::Activations value)
+{
+ if (value == ActivationIntf::Activations::Activating)
+ {
+ deleteImpl.reset();
+ updateManager->activatePackage();
+ }
+ else if (value == ActivationIntf::Activations::Active ||
+ value == ActivationIntf::Activations::Failed)
+ {
+ if (!deleteImpl)
+ {
+ deleteImpl = std::make_unique<Delete>(bus, objPath, updateManager);
+ }
+ }
+
+ return ActivationIntf::activation(value);
+}
+
+void Delete::delete_()
+{
+ updateManager->clearActivationInfo();
+}
+} // namespace fw_update
+} // namespace pldm