Allows iteration through the list of message headers received in the control parameter of the socket_sendto_control / socket_recvfrom_control methods. More...
#include <MsgHeader.h>
Public Member Functions | |
MsgHeaderIterator (nsapi_msghdr_t *hdr, nsapi_size_t size) | |
Create a MsgHeaderIterator over given nsapi_msghdr_t list. More... | |
bool | has_next () |
Checks if the next address of the iterator is a valid list member. More... | |
nsapi_msghdr_t * | next () |
Returns next element of the list. More... | |
Allows iteration through the list of message headers received in the control parameter of the socket_sendto_control / socket_recvfrom_control methods.
MsgHeaderIterator works on the list which members are of type nsapi_msghdr_t or other types extending this struct. For example nsapi_pktinfo:
There are two requirements for such structures to work well with MsgHeaderIterator.
This value is used in the MsgHeaderIterator to calculate proper addresses of the list elements.
Code presenting minimal usage example.
Definition at line 91 of file MsgHeader.h.
MsgHeaderIterator | ( | nsapi_msghdr_t * | hdr, |
nsapi_size_t | size | ||
) |
Create a MsgHeaderIterator over given nsapi_msghdr_t list.
hdr | Pointer to the first list element. |
size | Size of the whole list. |
Definition at line 97 of file MsgHeader.h.
bool has_next | ( | ) |
Checks if the next address of the iterator is a valid list member.
True | if the next address is a valid member. |
False | otherwise. |
Definition at line 108 of file MsgHeader.h.
nsapi_msghdr_t* next | ( | ) |
Returns next element of the list.
nullptr | if the list doesn't contain next element. |
Pointer | to the next element otherwise. |
Definition at line 134 of file MsgHeader.h.