An open API service indexing awesome lists of open source software.

https://github.com/stevencyb/securedlinkedlistmap

A Linked List Map implementation for Arduino, ESP 32 / 8266.
https://github.com/stevencyb/securedlinkedlistmap

Last synced: about 1 year ago
JSON representation

A Linked List Map implementation for Arduino, ESP 32 / 8266.

Awesome Lists containing this project

README

          

# Secured Linked List Map
The `SecuredLinkedList` is a library that provides the functionality of a Hashmap, without using hash.
Basically it is a linked list with key referencing. Furthermore, the implementation is thread-safe.
A small demo is given in `demo.ino`. A detailed description of the functions can be found below.
# Functions
- [SecuredLinkedListMap()](#SecuredLinkedListMap)
- [void put(T1 key, T2 value)](#put)
- [bool has(T1 key)](#has)
- [void getAll(SecuredLinkedListMapElement* copies)](#getAll)
- [T2 get(T1 key)](#get)
- [void remove(T1 key)](#remove)
- [int size()](#size)
- [void clear()](#clear)

## SecuredLinkedListMap()
The `SecuredLinkedListMap` can be instantiated as follows.
```
SecuredLinkedListMap mapA = SecuredLinkedListMap();
SecuredLinkedListMap *mapB = new SecuredLinkedListMap();
```

## void put(T1 key, T2 value)
Put a new key-value pair.
```
mapA.put("test", "hallo");
mapB->put(1, -1);
```

## bool has(T1 key)
Check whether the key exists.
```
Serial.println(mapA.has("hallo"));
Serial.println(mapB->has(-12));
```

## void getAll(SecuredLinkedListMapElement* copies)
Get a copy of all the elements in the map.
```
SecuredLinkedListMapElement mapAcopy[mapA.size()];
mapA.getAll(mapAcopy);

SecuredLinkedListMapElement mapBcopy[mapB->size()];
mapB->getAll(mapBcopy);
```

## T2 get(T1 key)
Get element by the key.
```
Serial.println(mapA.get("test"));
Serial.println(mapB->get(1));
```

## void remove(T1 key)
Remove element with key.
```
mapA.remove("test");
mapB->remove(1);
```

## int size()
Returns the number of elements in map.
```
Serial.println(mapA.size());
Serial.println(mapB->size());
```

## void clear()
Deletes all items from the list map.
```
mapA.clear();
mapB->clear();
```