#pragma once #include #include #include "poolDefinitions.h" namespace lpool { class TestPoolOwner : public SystemObject, public hk::GeneratesPeriodicHkIF { public: explicit TestPoolOwner(MessageQueueIF& queue, MessageQueueId_t hkDestId, object_id_t objectId = objects::TEST_LOCAL_POOL_OWNER_BASE); ~TestPoolOwner() override; [[nodiscard]] object_id_t getObjectId() const override { return SystemObject::getObjectId(); } ReturnValue_t serializeHkDataset(structure_id_t structureId, uint8_t* buf, size_t maxSize) override; ReturnValue_t specifyHkDatasets(std::vector& setList) override; SharedPool* getOptionalSharedPool() override; ReturnValue_t initialize() override; void setHkDestId(MessageQueueId_t id); /** Command queue for housekeeping messages. */ [[nodiscard]] MessageQueueId_t getCommandQueue() const override { return queue.getId(); } [[nodiscard]] MessageQueueMock& getMockQueueHandle() const { return dynamic_cast(queue); } ReturnValue_t enablePeriodicHk(dp::structure_id_t structureId, dur_millis_t frequencyMs) { return hkHelper.enablePeriodicPacket(structureId, frequencyMs); } ReturnValue_t reset(); hk::PeriodicHelper hkHelper; SharedPool sharedPool; Dataset set0; StaticTestDataset set1; TestDataset set2; private: PoolEntry u8PoolEntry = PoolEntry({0}); PoolEntry floatPoolEntry = PoolEntry({0}); PoolEntry u32PoolEntry = PoolEntry({0}); PoolEntry u16VecPoolEntry = PoolEntry({0, 0, 0}); PoolEntry i64VecPoolEntry = PoolEntry({0, 0}); dp::u8_t testUint8{sharedPool, lpool::uint8VarId}; dp::f32_t testFloat{sharedPool, lpool::floatVarId}; dp::u32_t testUint32{sharedPool, lpool::uint32VarId}; vec_t testUint16Vec{sharedPool, lpool::uint16Vec3Id}; vec_t testInt64Vec{sharedPool, lpool::int64Vec2Id}; MessageQueueIF& queue; bool initialized = false; bool initializedAfterTaskCreation = false; }; } // namespace lpool