libcommonc++  0.7
MACAddress Class Reference

A network hardware (MAC) address. More...

#include <MACAddress.h++>

Public Member Functions

 MACAddress ()
 Construct a new, null MACAddress (00:00:00:00:00:00). More...
 
 MACAddress (const byte_t octets[6])
 Construct a new MACAddress with the given octets. More...
 
 ~MACAddress ()
 Destructor. More...
 
void getOctets (byte_t octets[6]) const
 Get the octets of the MAC address. More...
 
void setOctets (const byte_t octets[6])
 Set the octets of the MAC address. More...
 
byte_t operator[] (int index) const
 Get the octet at the given index in the MAC address. More...
 
byte_toperator[] (int index)
 Get a reference to the octet at the given index in the MAC address. More...
 
String toString () const
 Return a String representation of the MACAddress. More...
 
bool operator== (const MACAddress &other) const
 Equality operator. More...
 
bool operator!= (const MACAddress &other) const
 Inequality operator. More...
 
bool operator! () const
 Test if this is a null address (00:00:00:00:00:00). More...
 

Detailed Description

A network hardware (MAC) address.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ MACAddress() [1/2]

Construct a new, null MACAddress (00:00:00:00:00:00).

◆ MACAddress() [2/2]

MACAddress ( const byte_t  octets[6])

Construct a new MACAddress with the given octets.

◆ ~MACAddress()

~MACAddress ( )

Destructor.

Member Function Documentation

◆ getOctets()

void getOctets ( byte_t  octets[6]) const

Get the octets of the MAC address.

◆ operator!()

bool operator! ( ) const

Test if this is a null address (00:00:00:00:00:00).

◆ operator!=()

bool operator!= ( const MACAddress other) const
inline

Inequality operator.

◆ operator==()

bool operator== ( const MACAddress other) const

Equality operator.

◆ operator[]() [1/2]

byte_t operator[] ( int  index) const

Get the octet at the given index in the MAC address.

Parameters
indexThe index.
Returns
The octet at the given index.
Exceptions
OutOfBoundsExceptionIf the index is invalid.

◆ operator[]() [2/2]

byte_t & operator[] ( int  index)

Get a reference to the octet at the given index in the MAC address.

Parameters
indexThe index.
Returns
A reference to the octet at the given index.
Exceptions
OutOfBoundsExceptionIf the index is invalid.

◆ setOctets()

void setOctets ( const byte_t  octets[6])

Set the octets of the MAC address.

◆ toString()

String toString ( ) const

Return a String representation of the MACAddress.


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