2021-09-25 21:31:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "test_pattern.hpp"
|
|
|
|
|
|
|
|
namespace hex::test {
|
|
|
|
|
|
|
|
class TestPatternPointers : public TestPattern {
|
|
|
|
public:
|
2022-01-24 19:53:17 +00:00
|
|
|
TestPatternPointers() : TestPattern("Pointers") {
|
2021-09-25 21:31:37 +00:00
|
|
|
// placementPointer
|
|
|
|
{
|
2022-01-29 11:40:49 +00:00
|
|
|
auto placementPointer = create<PatternDataPointer>("", "placementPointer", 0x0C, sizeof(u8));
|
2022-01-10 21:15:05 +00:00
|
|
|
placementPointer->setPointedAtAddress(0x49);
|
|
|
|
|
2022-01-29 11:40:49 +00:00
|
|
|
auto pointedTo = create<PatternDataUnsigned>("u32", "", 0x49, sizeof(u32));
|
2021-09-25 21:31:37 +00:00
|
|
|
placementPointer->setPointedAtPattern(pointedTo);
|
|
|
|
addPattern(placementPointer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
~TestPatternPointers() override = default;
|
|
|
|
|
2022-01-24 19:53:17 +00:00
|
|
|
[[nodiscard]] std::string getSourceCode() const override {
|
2021-09-25 21:31:37 +00:00
|
|
|
return R"(
|
|
|
|
u32 *placementPointer : u8 @ 0x0C;
|
|
|
|
)";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|