-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
どちらがよい,というものではない.しかし統一されているべきである.
SaveAsPcap での実装 (抜粋)
// Stackable が Absolute であることを検証する
auto absolute = std::dynamic_pointer_cast<Packet::Absolute>(stackable);
if (absolute == nullptr)
{
SPDLOG_WARN("The stackable is not Absolute.");
continue;
}SaveAsJson での実装 (抜粋)
// packet が Absolute であることを検証する
// TODO Absolute 型だけでなく,メタ情報を持つ Stackable であることを検証する.
auto &stackablePacketRef = *packet;
if (typeid(stackablePacketRef) == typeid(Packet::Absolute))
{
packetToGetJson = packet;
}
else
{
// メタ情報を持つ Stackable を持たない場合,強制的にメタ情報を付与する.
SPDLOG_WARN("The stackable does not have the meta information such as timestamp.",
"This packet will added a meta information");
auto pseudoAbsolute = std::make_shared<Packet::Absolute>();
pseudoAbsolute->TimestampNs.Value(std::chrono::seconds(index));
packetToGetJson = pseudoAbsolute;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels