GY-63_MS5611/libraries/Set
2024-04-13 10:35:57 +02:00
..
.github bulk update GitHub actions 2024-04-13 10:35:57 +02:00
examples sync with git repositories 2022-05-19 12:33:49 +02:00
test 0.2.5 Set 2021-12-28 10:38:33 +01:00
.arduino-ci.yml 0.2.6 SET 2022-11-24 11:20:43 +01:00
CHANGELOG.md 0.2.7 SET 2023-11-21 16:32:57 +01:00
keywords.txt 0.2.5 Set 2021-12-28 10:38:33 +01:00
library.json 0.2.7 SET 2023-11-21 16:32:57 +01:00
library.properties 0.2.7 SET 2023-11-21 16:32:57 +01:00
LICENSE bulk update GitHub actions 2024-04-13 10:35:57 +02:00
README.md 0.2.7 SET 2023-11-21 16:32:57 +01:00
Set.cpp 0.2.7 SET 2023-11-21 16:32:57 +01:00
Set.h 0.2.7 SET 2023-11-21 16:32:57 +01:00

Arduino CI Arduino-lint JSON check GitHub issues

License: MIT GitHub release PlatformIO Registry

SET

Arduino library to implement a simple SET data structure.

Description

The set library implements the set data structure for integers 0..255. This limit is chosen because of the memory limitations of an Arduino UNO, however these numbers can be used as indices to a table of strings or other data types.

Interface

#include "SET.h"

Constructor

  • Set(bool clear = true) creates an empty set, default it is cleared.
  • Set(&Set) copies a set.

Set level

  • clear() empty the set.
  • invert() flip all elements in the set.
  • addAll() add all 256 elements to the set.
  • count() returns the number of elements.
  • isEmpty() idem
  • isFull() idem

Element level

  • add(uint8_t value) add element n to the Set.
  • sub(uint8_t value) remove element n from the Set.
  • invert(uint8_t value) flip element n in the Set.
  • has(uint8_t value) check if element n is in the Set.

Operators

  • union + +=
  • diff - -=
  • intersection * *=

Equality

  • equal ==
  • not equal !=
  • is subSet <=

A superSet B is not implemented as one could say B subSet A (B <= A)

Iterators

all iterator-functions returns the current element or -1 if not exist.

  • setCurrent(n) if n is in the Set, n will be the current
  • first() find the first element
  • next() find the next element. Will not wrap around when 'end' of the set is reached.
  • prev() find the previous element. Will not wrap around when 'begin' of the set is reached.
  • last() find the last element.
  • getNth(n) find the Nth element in a set if it exist.

Operational

See examples

Future

Must

  • update documentation

Should

Could

Wont

Support

If you appreciate my libraries, you can support the development and maintenance. Improve the quality of the libraries by providing issues and Pull Requests, or donate through PayPal or GitHub sponsors.

Thank you,