NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NetSim::Header Class Reference

Class representing headers for different protocols. More...

#include <header.h>

Public Member Functions

 Header ()=default
 Default constructor.
 
 Header (const HeaderType &headerType, const QList< HeaderAttribute > &headerList)
 Parameterized constructor.
 
void addHeaderAttribute (const HeaderAttribute &headerAttribute)
 Adds a header attribute to the header.
 
void setHeaderType (const HeaderType &headerType)
 Sets the header type.
 
QList< HeaderAttributeheaderList () const
 Retrieves the list of header attributes.
 
HeaderType type () const
 Retrieves the header type.
 
quint16 size () const
 Calculates the size of the header.
 
HeaderAttributeoperator[] (const QString &name)
 Overloaded subscript operator to get a header attribute by its name.
 

Detailed Description

Class representing headers for different protocols.

Constructor & Destructor Documentation

◆ Header() [1/2]

NetSim::Header::Header ( )
default

Default constructor.

◆ Header() [2/2]

Header::Header ( const HeaderType headerType,
const QList< HeaderAttribute > &  headerList 
)

Parameterized constructor.

Parameters
headerTypeType of header.
headerListList of header attributes.

Member Function Documentation

◆ addHeaderAttribute()

void Header::addHeaderAttribute ( const HeaderAttribute headerAttribute)

Adds a header attribute to the header.

Parameters
headerAttributeThe header attribute to be added.
Here is the caller graph for this function:

◆ headerList()

QList< HeaderAttribute > Header::headerList ( ) const

Retrieves the list of header attributes.

Return values
QList<HeaderAttribute>List of header attributes.
Here is the caller graph for this function:

◆ operator[]()

HeaderAttribute & Header::operator[] ( const QString &  name)

Overloaded subscript operator to get a header attribute by its name.

Parameters
nameName of the header attribute.
Return values
HeaderAttribute&Reference to the header attribute.
Exceptions
HeaderAttributeNotFoundExceptionIf the named attribute is not found.

◆ setHeaderType()

void Header::setHeaderType ( const HeaderType headerType)

Sets the header type.

Parameters
headerTypeType of the header.
Here is the caller graph for this function:

◆ size()

quint16 Header::size ( ) const

Calculates the size of the header.

Return values
quint16Size of the header in bytes.

◆ type()

HeaderType Header::type ( ) const

Retrieves the header type.

Return values
HeaderTypeType of the header.

The documentation for this class was generated from the following files: