#include <CsmaCaMacHeaderSerializer.h>
◆ CsmaCaMacTrailerSerializer()
| inet::CsmaCaMacTrailerSerializer::CsmaCaMacTrailerSerializer |
( |
| ) |
|
|
inline |
36 : FieldsChunkSerializer() {}
◆ deserialize()
Deserializes a chunk from a stream by reading the bytes at the current position of the stream.
The current stream position is updated according to the length of the returned chunk.
Implements inet::FieldsChunkSerializer.
91 auto macTrailer = makeShared<CsmaCaMacTrailer>();
92 auto fcs = stream.readUint32Be();
93 macTrailer->setFcs(fcs);
◆ serialize()
| void inet::CsmaCaMacTrailerSerializer::serialize |
( |
MemoryOutputStream & |
stream, |
|
|
const Ptr< const Chunk > & |
chunk |
|
) |
| const |
|
overrideprotectedvirtual |
Serializes a chunk into a stream by writing all bytes representing the chunk at the end of the stream.
Implements inet::FieldsChunkSerializer.
82 const auto& macTrailer = dynamicPtrCast<const CsmaCaMacTrailer>(chunk);
83 auto fcsMode = macTrailer->getFcsMode();
85 throw cRuntimeError(
"Cannot serialize CsmaCaMacTrailer without properly computed FCS, try changing the value of the fcsMode parameter (e.g. in the CsmaCaMac module)");
86 stream.writeUint32Be(macTrailer->getFcs());
The documentation for this class was generated from the following files: