0.2.7 SET

This commit is contained in:
Rob Tillaart 2023-11-21 16:32:57 +01:00
parent 501a20577c
commit f885785fe2
6 changed files with 49 additions and 23 deletions

View File

@ -6,11 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.2.7] - 2023-11-21
- update readme.md
## [0.2.6] - 2022-10-28
- Add RP2040 support to build-CI.
- Add CHANGELOG.md
## [0.2.5] - 2021-12-28
- update library.json
- update readme

View File

@ -2,8 +2,11 @@
[![Arduino CI](https://github.com/RobTillaart/SET/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/SET/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/SET/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/SET/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/SET/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/SET.svg)](https://github.com/RobTillaart/SET/issues)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/SET/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/SET.svg?maxAge=3600)](https://github.com/RobTillaart/SET/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/SET.svg)](https://registry.platformio.org/libraries/robtillaart/SET)
# SET
@ -21,6 +24,9 @@ data types.
## Interface
```cpp
#include "SET.h"
```
### Constructor
@ -81,5 +87,22 @@ 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,

View File

@ -1,7 +1,7 @@
//
// FILE: set.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.2.6
// VERSION: 0.2.7
// DATE: 2014-09-11
// PURPOSE: SET library for Arduino
// URL: https://github.com/RobTillaart/SET

View File

@ -2,7 +2,7 @@
//
// FILE: set.h
// AUTHOR: Rob Tillaart
// VERSION: 0.2.6
// VERSION: 0.2.7
// DATE: 2014-09-11
// PURPOSE: SET library for Arduino
// URL: https://github.com/RobTillaart/SET
@ -11,20 +11,20 @@
#include "Arduino.h"
#define SET_LIB_VERSION (F("0.2.6"))
#define SET_LIB_VERSION (F("0.2.7"))
class Set
{
public:
explicit Set(const bool clear = true); // create empty Set
Set(const Set &t); // create copy Set
Set(const Set &t); // create copy Set
void clear(); // clear the Set
void clr() { clear(); }; // will become obsolete 0.3.0
void invert(); // flip all elements in the Set
void addAll(); // add all elements
uint16_t count() const; // return the #elements
void clear(); // clear the Set
void clr() { clear(); }; // will become obsolete 0.3.0
void invert(); // flip all elements in the Set
void addAll(); // add all elements
uint16_t count() const; // return the #elements
bool isEmpty();
bool isFull();
@ -35,21 +35,21 @@ public:
bool has(const uint8_t value); // element is in Set
Set operator + (const Set &); // union
Set operator - (const Set &); // diff
Set operator * (const Set &); // intersection
Set operator + (const Set &); // union
Set operator - (const Set &); // diff
Set operator * (const Set &); // intersection
void operator += (const Set &); // union
void operator -= (const Set &); // diff
void operator *= (const Set &); // intersection
void operator += (const Set &); // union
void operator -= (const Set &); // diff
void operator *= (const Set &); // intersection
bool operator == (const Set &) const; // equal
bool operator != (const Set &) const; // not equal
bool operator <= (const Set &) const; // is subSet,
// a superSet b is not implemented as one could
// a superSet b is not implemented as one could
// say b subSet a (b <= a)
// a <= b
// a <= b
// iterating through the Set
@ -66,11 +66,11 @@ private:
uint8_t _mem[32]; // can hold 0..255
uint8_t _masks[8] = {1, 2, 4, 8, 16, 32, 64, 128};
int _current = -1;
int findNext(const uint8_t p, const uint8_t q); // helper for first, next
int findPrev(const uint8_t p, const uint8_t q); // helper for last, prev
};
// -- END OF FILE --
// -- END OF FILE --

View File

@ -15,9 +15,9 @@
"type": "git",
"url": "https://github.com/RobTillaart/SET.git"
},
"version": "0.2.6",
"version": "0.2.7",
"license": "MIT",
"frameworks": "arduino",
"frameworks": "*",
"platforms": "*",
"headers": "set.h"
}

View File

@ -1,5 +1,5 @@
name=SET
version=0.2.6
version=0.2.7
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library to implement simple SET datastructure.