Definition at line 32 of file list.h.
◆ ItemList()
◆ addItem()
Add item into a list.
- Parameters
-
pId | is pointer to costant id string. |
val | is value of item. |
- Returns
- pItem is pointer to new created object
At the beginning is checked validity of id. Than is called Item class constructor which create new item in list.
Definition at line 43 of file list.cpp.
◆ deleteHead()
void ItemList::deleteHead |
( |
| ) |
|
Delete head of list.
If head of list is null the linking to list is lost – list deleted.
Definition at line 102 of file list.cpp.
◆ deleteItem()
void ItemList::deleteItem |
( |
Item * |
pItem | ) |
|
Delete item from a list.
- Parameters
-
pItem | is pointer to object Item. |
At the beginning is checked if pointer to object is not null. If item is not pHead (pointer to first item in list) than the pNext pointer of deleted object is saved into pNext pointer of previous object in list.
Definition at line 72 of file list.cpp.
◆ editItemId()
char * ItemList::editItemId |
( |
Item * |
pItem, |
|
|
const char * |
pNewId |
|
) |
| |
Edit item id in a list.
- Parameters
-
pItem | is pointer to object Item. |
pNewId | is pointer to new item id. |
- Returns
- pItem->id which is pointer to new id string
Definition at line 113 of file list.cpp.
◆ editItemVal()
void ItemList::editItemVal |
( |
Item * |
pItem, |
|
|
uint16_t |
val |
|
) |
| |
Edit item value in a list.
- Parameters
-
pItem | is pointer to object Item. |
val | is new value of the item. |
If pointer to callback function is not null, than call callback.
Definition at line 128 of file list.cpp.
◆ findItem()
Find item in a list.
- Parameters
-
pId | is pointer to item id. |
- Returns
- pItem which is a pointer to object item (null if id is not valid).
Definition at line 142 of file list.cpp.
◆ getItemVal()
uint16_t ItemList::getItemVal |
( |
Item * |
pItem | ) |
|
Get item value.
- Returns
- pItem->value (0 if item object is null)
Definition at line 191 of file list.cpp.
◆ getNumOfItems()
uint8_t ItemList::getNumOfItems |
( |
| ) |
|
Get number of item in a list.
- Returns
- _numOfItems
Definition at line 183 of file list.cpp.
◆ isIdLenValid()
bool ItemList::isIdLenValid |
( |
const char * |
pId | ) |
|
Check if lingth of id is valid.
- Parameters
-
pId | is pointer to item id. |
- Returns
true
if lingth of id is valid, false
otherwise.
Definition at line 171 of file list.cpp.
◆ isInList()
bool ItemList::isInList |
( |
Item * |
pItem | ) |
|
Check if item is in a list.
- Parameters
-
pItem | is pointer to object Item. |
val | is new value of the item. * |
- Returns
true
if item is in the list, false
otherwise.
Definition at line 162 of file list.cpp.
◆ isListEmpty()
bool ItemList::isListEmpty |
( |
| ) |
|
◆ printData()
void ItemList::printData |
( |
| ) |
|
Print data from list to serial.
It is functional only if user calls Serial.begin(baudrate) in a setup.
Definition at line 203 of file list.cpp.
◆ _numOfItems
uint8_t ItemList::_numOfItems = 0 |
|
protected |
◆ _pHead
Item* ItemList::_pHead = nullptr |
|
protected |
◆ _pLast
Item* ItemList::_pLast = nullptr |
|
protected |
The documentation for this class was generated from the following files: