Refactor ScitForecastDataPacket to ScitDataPacket

This commit is contained in:
Dan Paulat 2024-02-03 08:53:23 -06:00
parent 3b110516ed
commit d92c1e50f2
6 changed files with 128 additions and 137 deletions

View file

@ -0,0 +1,43 @@
#pragma once
#include <scwx/wsr88d/rpg/special_graphic_symbol_packet.hpp>
#include <cstdint>
#include <memory>
namespace scwx
{
namespace wsr88d
{
namespace rpg
{
class ScitDataPacket : public SpecialGraphicSymbolPacket
{
public:
explicit ScitDataPacket();
~ScitDataPacket();
ScitDataPacket(const ScitDataPacket&) = delete;
ScitDataPacket& operator=(const ScitDataPacket&) = delete;
ScitDataPacket(ScitDataPacket&&) noexcept;
ScitDataPacket& operator=(ScitDataPacket&&) noexcept;
const std::vector<std::uint8_t>& data() const;
std::size_t RecordCount() const override;
static std::shared_ptr<ScitDataPacket> Create(std::istream& is);
protected:
bool ParseData(std::istream& is) override;
private:
class Impl;
std::unique_ptr<Impl> p;
};
} // namespace rpg
} // namespace wsr88d
} // namespace scwx

View file

@ -1,44 +0,0 @@
#pragma once
#include <scwx/wsr88d/rpg/special_graphic_symbol_packet.hpp>
#include <cstdint>
#include <memory>
namespace scwx
{
namespace wsr88d
{
namespace rpg
{
class ScitForecastDataPacketImpl;
class ScitForecastDataPacket : public SpecialGraphicSymbolPacket
{
public:
explicit ScitForecastDataPacket();
~ScitForecastDataPacket();
ScitForecastDataPacket(const ScitForecastDataPacket&) = delete;
ScitForecastDataPacket& operator=(const ScitForecastDataPacket&) = delete;
ScitForecastDataPacket(ScitForecastDataPacket&&) noexcept;
ScitForecastDataPacket& operator=(ScitForecastDataPacket&&) noexcept;
const std::vector<uint8_t>& data() const;
size_t RecordCount() const override;
static std::shared_ptr<ScitForecastDataPacket> Create(std::istream& is);
protected:
bool ParseData(std::istream& is) override;
private:
std::unique_ptr<ScitForecastDataPacketImpl> p;
};
} // namespace rpg
} // namespace wsr88d
} // namespace scwx