NetSim 1.0.0
An educational network simulation software for students
|
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< HeaderAttribute > | headerList () const |
Retrieves the list of header attributes. | |
HeaderType | type () const |
Retrieves the header type. | |
quint16 | size () const |
Calculates the size of the header. | |
HeaderAttribute & | operator[] (const QString &name) |
Overloaded subscript operator to get a header attribute by its name. | |
Class representing headers for different protocols.
|
default |
Default constructor.
Header::Header | ( | const HeaderType & | headerType, |
const QList< HeaderAttribute > & | headerList | ||
) |
Parameterized constructor.
headerType | Type of header. |
headerList | List of header attributes. |
void Header::addHeaderAttribute | ( | const HeaderAttribute & | headerAttribute | ) |
Adds a header attribute to the header.
headerAttribute | The header attribute to be added. |
QList< HeaderAttribute > Header::headerList | ( | ) | const |
Retrieves the list of header attributes.
QList<HeaderAttribute> | List of header attributes. |
HeaderAttribute & Header::operator[] | ( | const QString & | name | ) |
Overloaded subscript operator to get a header attribute by its name.
name | Name of the header attribute. |
HeaderAttribute& | Reference to the header attribute. |
HeaderAttributeNotFoundException | If the named attribute is not found. |
void Header::setHeaderType | ( | const HeaderType & | headerType | ) |
Sets the header type.
headerType | Type of the header. |
quint16 Header::size | ( | ) | const |
Calculates the size of the header.
quint16 | Size of the header in bytes. |
HeaderType Header::type | ( | ) | const |
Retrieves the header type.
HeaderType | Type of the header. |