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

Represents a Media Access Control (MAC) address. More...

#include <macaddress.h>

Public Member Functions

 MACAddress ()=default
 Default constructor initializing an empty MAC address.
 
 MACAddress (const QVector< quint8 > &address)
 Constructs a MACAddress from a given byte array.
 
QString toString () const
 Converts the MAC address to a string format.
 
QVector< quint8 > toArray () const
 Converts the MAC address to a byte array.
 
quint64 toInt () const
 Converts the MAC address to an integer format.
 
bool operator< (const MACAddress &other) const
 Overload of the less than operator.
 
bool operator== (const MACAddress &other) const
 Overload of the equality operator.
 

Static Public Member Functions

static MACAddress getRandomAddress ()
 Generates a random MAC address.
 

Detailed Description

Represents a Media Access Control (MAC) address.

This class provides functionalities to represent a MAC address, and offers various conversion utilities like converting to string, array or an integer format.

Constructor & Destructor Documentation

◆ MACAddress() [1/2]

NetSim::MACAddress::MACAddress ( )
default

Default constructor initializing an empty MAC address.

Here is the caller graph for this function:

◆ MACAddress() [2/2]

MACAddress::MACAddress ( const QVector< quint8 > &  address)
explicit

Constructs a MACAddress from a given byte array.

Parameters
addressA byte array representing the MAC address.

Member Function Documentation

◆ getRandomAddress()

MACAddress MACAddress::getRandomAddress ( )
static

Generates a random MAC address.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<()

bool MACAddress::operator< ( const MACAddress other) const

Overload of the less than operator.

Compares this MAC address to another based on their integer format.

Parameters
otherThe other MAC address to compare against.
Returns
true if this MAC address is less than the other, false otherwise.
Here is the call graph for this function:

◆ operator==()

bool MACAddress::operator== ( const MACAddress other) const

Overload of the equality operator.

Checks if this MAC address is equal to another based on their integer format.

Parameters
otherThe other MAC address to compare against.
Returns
true if the MAC addresses are equal, false otherwise.
Here is the call graph for this function:

◆ toArray()

QVector< quint8 > MACAddress::toArray ( ) const

Converts the MAC address to a byte array.

Here is the caller graph for this function:

◆ toInt()

quint64 MACAddress::toInt ( ) const

Converts the MAC address to an integer format.

Here is the caller graph for this function:

◆ toString()

QString MACAddress::toString ( ) const

Converts the MAC address to a string format.

Here is the caller graph for this function:

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