#include "SearchPacketData.hpp"

#include "utils/serialize/basics.hpp"


namespace drp::packet::search {


std::vector<std::uint8_t> SearchPacketData::serialize() const {
    // serialize the members
    const auto serializedTimestamp = util::serialize::serializeObject(this->timestamp);

    return serializedTimestamp;
}


SearchPacketData SearchPacketData::deserialize(std::vector<std::uint8_t>& data) {
    // deserialize the members
    const auto packetTimestamp = util::serialize::deserializeObject<std::chrono::time_point<std::chrono::high_resolution_clock>>(data);

    return SearchPacketData(packetTimestamp);
}


}
