Manojkiran Eda | 1b5ec9c | 2020-06-13 15:29:28 +0530 | [diff] [blame] | 1 | #include "mock_network_manager.hpp" |
| 2 | #include "types.hpp" |
| 3 | |
| 4 | #include <sdeventplus/event.hpp> |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | |
| 9 | namespace network |
| 10 | { |
| 11 | |
| 12 | std::unique_ptr<MockManager> manager = nullptr; |
| 13 | std::unique_ptr<Timer> refreshObjectTimer = nullptr; |
William A. Kennington III | c7cf25f | 2021-11-09 16:16:59 -0800 | [diff] [blame] | 14 | std::unique_ptr<Timer> reloadTimer = nullptr; |
Manojkiran Eda | 1b5ec9c | 2020-06-13 15:29:28 +0530 | [diff] [blame] | 15 | |
| 16 | /** @brief refresh the network objects. */ |
| 17 | void refreshObjects() |
| 18 | { |
| 19 | if (manager) |
| 20 | { |
| 21 | manager->createChildObjects(); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | void initializeTimers() |
| 26 | { |
| 27 | refreshObjectTimer = std::make_unique<Timer>( |
| 28 | sdeventplus::Event::get_default(), std::bind(refreshObjects)); |
| 29 | } |
| 30 | |
| 31 | } // namespace network |
| 32 | } // namespace phosphor |