INET Framework for OMNeT++/OMNEST
inet::Ieee802EpdHeaderSerializer Class Reference

#include <Ieee802EpdHeaderSerializer.h>

Inheritance diagram for inet::Ieee802EpdHeaderSerializer:
inet::FieldsChunkSerializer inet::ChunkSerializer

Public Member Functions

 Ieee802EpdHeaderSerializer ()
 
- Public Member Functions inherited from inet::FieldsChunkSerializer
virtual void serialize (MemoryOutputStream &stream, const Ptr< const Chunk > &chunk, b offset, b length) const override
 Serializes a chunk into a stream by writing the bytes representing the chunk at the end of the stream. More...
 
virtual const Ptr< Chunkdeserialize (MemoryInputStream &stream, const std::type_info &typeInfo) const override
 Deserializes a chunk from a stream by reading the bytes at the current position of the stream. More...
 

Protected Member Functions

virtual void serialize (MemoryOutputStream &stream, const Ptr< const Chunk > &chunk) const override
 Serializes a chunk into a stream by writing all bytes representing the chunk at the end of the stream. More...
 
virtual const Ptr< Chunkdeserialize (MemoryInputStream &stream) const override
 Deserializes a chunk from a stream by reading the bytes at the current position of the stream. More...
 

Additional Inherited Members

- Static Public Attributes inherited from inet::ChunkSerializer
static b totalSerializedLength = b(0)
 
static b totalDeserializedLength = b(0)
 

Constructor & Destructor Documentation

◆ Ieee802EpdHeaderSerializer()

inet::Ieee802EpdHeaderSerializer::Ieee802EpdHeaderSerializer ( )
inline
21 : FieldsChunkSerializer() {}

Member Function Documentation

◆ deserialize()

const Ptr< Chunk > inet::Ieee802EpdHeaderSerializer::deserialize ( MemoryInputStream stream) const
overrideprotectedvirtual

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.

23 {
24  Ptr<Ieee802EpdHeader> llcHeader = makeShared<Ieee802EpdHeader>();
25  llcHeader->setEtherType(stream.readUint16Be());
26  return llcHeader;
27 }

◆ serialize()

void inet::Ieee802EpdHeaderSerializer::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.

17 {
18  const auto& llcHeader = CHK(dynamicPtrCast<const Ieee802EpdHeader>(chunk));
19  stream.writeUint16Be(llcHeader->getEtherType());
20 }

The documentation for this class was generated from the following files:
CHK
#define CHK(x)
Definition: INETDefs.h:87