From f885785fe250c42a5a6827551a75820ab25f582e Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Tue, 21 Nov 2023 16:32:57 +0100 Subject: [PATCH] 0.2.7 SET --- libraries/Set/CHANGELOG.md | 5 ++++- libraries/Set/README.md | 23 ++++++++++++++++++++ libraries/Set/Set.cpp | 2 +- libraries/Set/Set.h | 36 ++++++++++++++++---------------- libraries/Set/library.json | 4 ++-- libraries/Set/library.properties | 2 +- 6 files changed, 49 insertions(+), 23 deletions(-) diff --git a/libraries/Set/CHANGELOG.md b/libraries/Set/CHANGELOG.md index 64a00d72..b318cf5c 100644 --- a/libraries/Set/CHANGELOG.md +++ b/libraries/Set/CHANGELOG.md @@ -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 diff --git a/libraries/Set/README.md b/libraries/Set/README.md index 955fba13..43c6d448 100644 --- a/libraries/Set/README.md +++ b/libraries/Set/README.md @@ -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, + diff --git a/libraries/Set/Set.cpp b/libraries/Set/Set.cpp index 5c47081c..2ce6deec 100644 --- a/libraries/Set/Set.cpp +++ b/libraries/Set/Set.cpp @@ -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 diff --git a/libraries/Set/Set.h b/libraries/Set/Set.h index 3fea6142..1c41efb2 100644 --- a/libraries/Set/Set.h +++ b/libraries/Set/Set.h @@ -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 -- diff --git a/libraries/Set/library.json b/libraries/Set/library.json index aa8bf8b1..bb84c40f 100644 --- a/libraries/Set/library.json +++ b/libraries/Set/library.json @@ -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" } diff --git a/libraries/Set/library.properties b/libraries/Set/library.properties index 95b90381..5d418f51 100644 --- a/libraries/Set/library.properties +++ b/libraries/Set/library.properties @@ -1,5 +1,5 @@ name=SET -version=0.2.6 +version=0.2.7 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library to implement simple SET datastructure.