Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ Language: Cpp
BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left
# AlignArrayOfStructures: Left
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Right
AlignEscapedNewlines: Left
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: false
Expand Down Expand Up @@ -42,14 +42,14 @@ BraceWrapping:
BeforeElse: true
# BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
# IndentBraces: true
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: Always
BreakBeforeTernaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
BreakStringLiterals: true
Expand All @@ -59,11 +59,11 @@ ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: true
DerivePointerAlignment: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: true
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<(snitch|nanobench).*>'
Expand Down Expand Up @@ -93,11 +93,12 @@ IndentPPDirectives: BeforeHash
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: false
IndentRequiresClause: true
InsertTrailingCommas: None
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MaxEmptyLinesToKeep: 4
NamespaceIndentation: Inner
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
PackConstructorInitializers: Never
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 100000
Expand All @@ -106,16 +107,17 @@ PenaltyBreakFirstLessLess: 64
PenaltyBreakOpenParenthesis: 10000000
PenaltyBreakString: 64
PenaltyBreakTemplateDeclaration: 4
PenaltyExcessCharacter: 2
PenaltyExcessCharacter: 1
PenaltyIndentedWhitespace: 512
PenaltyReturnTypeOnItsOwnLine: 1000
PenaltyReturnTypeOnItsOwnLine: 10000
PointerAlignment: Left
QualifierAlignment: Leave
ReferenceAlignment: Pointer
RemoveBracesLLVM: false
ReflowComments: false
RemoveSemicolon: true
ReflowComments: true
RequiresClausePosition: OwnLine
SeparateDefinitionBlocks: Always
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 0
SortIncludes: CaseSensitive
SortUsingDeclarations: true
Expand Down Expand Up @@ -153,5 +155,5 @@ Standard: c++20
TabWidth: 0
UseCRLF: true
UseTab: Never
NamespaceMacros: ['BENCHMARK', 'SECTION']
StatementAttributeLikeMacros: ['RPP_NO_UNIQUE_ADDRESS']
NamespaceMacros: ['BENCHMARK']
StatementAttributeLikeMacros: ['RPP_NO_UNIQUE_ADDRESS']
4 changes: 3 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,bugprone-*,concurrency-*,performance-*,-macro*,readability-identifier-naming,-bugprone-exception-escape'
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,bugprone-*,concurrency-*,performance-*,-macro*,readability-identifier-naming,-bugprone-exception-escape'
ExtraArgs: ['-std=c++20']
WarningsAsErrors: '*'
HeaderFilterRegex: './src/.*'
AnalyzeTemporaryDtors: false
Expand All @@ -15,4 +16,5 @@ CheckOptions:
- { key: readability-identifier-naming.StaticVariablePrefix, value: s_ }
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
- { key: readability-identifier-naming.TypeTemplateParameterCase, value: CamelCase }
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
# - { key: readability-identifier-naming.TypeAliasCase, value: lower_case }
22 changes: 11 additions & 11 deletions .github/workflows/analyzers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
- "CI v2"
types:
- completed

jobs:
pvs:

runs-on: ubuntu-latest
timeout-minutes: 10

if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success'

steps:
Expand All @@ -24,14 +24,14 @@ jobs:
fetch-depth: 0
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}

# Work around https://github.com/actions/runner-images/issues/8659
- name: "Remove GCC 13 from runner image (workaround)"
shell: bash
run: |
sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev
sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.*

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -50,7 +50,7 @@ jobs:
sudo apt update
sudo apt install pvs-studio libsfml-dev
pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }}

- name: Run CMake
if: steps.setup.outcome == 'success' && steps.setup.conclusion == 'success'
uses: lukka/run-cmake@v10
Expand All @@ -73,7 +73,7 @@ jobs:

sonarcloud_and_coverage:
runs-on: ubuntu-latest

if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success'

env:
Expand All @@ -88,7 +88,7 @@ jobs:
fetch-depth: 0
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}

- name: Install llvm
run: sudo apt-get update -q && sudo apt-get install llvm libsfml-dev -q -y

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:

- name: Process coverage info
run: cmake --build build -t coverage

- name: "Get PR information"
uses: potiuk/get-workflow-origin@v1_3
id: source-run-info
Expand All @@ -131,7 +131,7 @@ jobs:
override_branch: ${{ github.event.workflow_run.head_branch }}
override_pr: ${{ steps.source-run-info.outputs.pullRequestNumber }}
override_commit: ${{ github.event.workflow_run.head_sha }}

- name: Run sonar-scanner on PUSH
if: github.event.workflow_run.event == 'push'
env:
Expand All @@ -148,4 +148,4 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.scm.revision=${{ github.event.workflow_run.head_sha }} --define sonar.pullrequest.key=${{ steps.source-run-info.outputs.pullRequestNumber }} --define sonar.pullrequest.branch=${{ steps.source-run-info.outputs.sourceHeadBranch }} --define sonar.pullrequest.base=${{ steps.source-run-info.outputs.targetBranch }}

9 changes: 7 additions & 2 deletions .github/workflows/ci v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
branches:
- v2

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true


jobs:
sanitize:
strategy:
Expand All @@ -21,7 +26,7 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand Down Expand Up @@ -78,7 +83,7 @@ jobs:
run: |
sudo apt-get update -q && sudo apt-get install clang-tidy cppcheck libsfml-dev -y -q
pip install pyyaml

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/comment_benchmarks_v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ on:
- "CI v2"
types:
- completed

jobs:
process_benchmarks:
runs-on: ubuntu-latest

if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success'

steps:
- uses: haya14busa/action-workflow_run-status@v1

- name: "Get PR information"
uses: potiuk/get-workflow-origin@v1_3
id: source-run-info
Expand Down Expand Up @@ -89,4 +89,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages

43 changes: 43 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.10.0
hooks:
- id: check-github-actions
- id: check-github-workflows

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
require_serial: true
# - id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v16.0.6'
hooks:
- id: clang-format
args: ["-style=file", "-i"]
types_or: [c++, c]
require_serial: true

# - repo: local
# hooks:
# - id: compile_json
# name: compile_json
# entry: cmake --preset=ci-coverage-clang
# always_run: true
# require_serial: true
# pass_filenames: false
# language: system

# - repo: https://github.com/pocc/pre-commit-hooks
# rev: master
# hooks:
# - id: clang-tidy
# args: [--fix-errors, -config-file=.clang-tidy, --checks=-readability-identifier-naming*]
# files: src/.*
# entry: /usr/local/opt/llvm/bin/clang-tidy
4 changes: 2 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ This project exports a CMake package to be used with the [`find_package`][3]
command of CMake:

* Package name: `RPP`
* Target names:
* Target names:
- `RPP::rpp` - main rpp INTERFACE target
- `RPP::rppqt` - additional INTERFACE target to extend functionality for QT. rppqt doesn't include QT or even doesn't link with that.

Expand Down Expand Up @@ -111,7 +111,7 @@ To avoid including "everyting" you can just include some iterested part of code
#include <rpp/operators/map.hpp>
#include <rpp/observables/fwd.hpp>
```
**NOTE**: In case of partial including of operators you need to include headers for each used operators like
**NOTE**: In case of partial including of operators you need to include headers for each used operators like
```cpp
#include <rpp/operators/map.hpp>
#include <rpp/operators/filter.hpp>
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Hello dear contributor! Before hand thank you for your contribution to RPP!
Hello dear contributor! Before hand thank you for your contribution to RPP!

Below you can find some useful info about contribution to RPP project
## Getting started
Expand Down Expand Up @@ -33,7 +33,7 @@ void my_long_function()
int my_short_function() { return 2; }

# Option 2
int my_short_function()
int my_short_function()
{
return 2;
}
Expand Down
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ There we are creating observable which emits value via invoking of `getchar` fun

## Why do you need it?

Check the [User Guide](https://victimsnino.github.io/ReactivePlusPlus/v2/docs/html/md_docs_2readme.html) for a detailed overview of the Reactive Programming concept and RPP itself.
Check the [User Guide](https://victimsnino.github.io/ReactivePlusPlus/v2/docs/html/md_docs_2readme.html) for a detailed overview of the Reactive Programming concept and RPP itself.

In short, RPP can help you build complex pipelines to distribute values over time, connect "some sources of data" without directly connecting them.

Expand Down Expand Up @@ -121,12 +121,12 @@ Now we have separate observables for separate sources of dynamic data like click

## What about existing Reactive Extension libraries for C++?

Reactive programming is excelent programming paradigm and approach for creation of multi-threading and real-time programs which reacts on some events. Unfortunately, there is only one stable and fully-implemented library at the moment of creation of ReactivePlusPlus - [RxCpp](https://github.com/ReactiveX/RxCpp).
Reactive programming is excelent programming paradigm and approach for creation of multi-threading and real-time programs which reacts on some events. Unfortunately, there is only one stable and fully-implemented library at the moment of creation of ReactivePlusPlus - [RxCpp](https://github.com/ReactiveX/RxCpp).

[RxCpp](https://github.com/ReactiveX/RxCpp) is great and awesome library and perfect implementation of ReactiveX approach. However RxCpp has some disadvantages:
- It is a bit **"old" library written in C++11** with some parts written in the **pre-C++11 style** (mess of old-style classes and wrappers)
- **Issue** with **template parameters**: `rxcpp::observable` contains **full chain of operators** as second template parameter... where each operator has a bunch of another template parameters itself. It forces **IDEs** works **slower** while parsing resulting type of observable. Also it forces to generate **heavier binaries and debug symbols and slower build time**.
- It has high perfomance cost due to tremendous amount of usage of heap.
- It has high perfomance cost due to tremendous amount of usage of heap.
- Some parts of code written with non-effective logic

Another implementation of RX for c++: [another-rxcpp](https://github.com/CODIANZ/another-rxcpp). It partly solves issues of RxCpp via **eliminating of template parameter** with help of **type-erasing** and making each callback as `std::function`. As a result issue with templates resvoled, but this approach has disadvantages related to runtime: resulting size of observers/observables becomes greater due to heavy `std::function` object, usage of heap for storing everything causes perfomance issues, implementation is just pretty simple and provides a lot of copies of passed objects.
Expand Down
14 changes: 7 additions & 7 deletions cmake/install-rules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ include(GNUInstallDirs)
set(package RPP)

install(
DIRECTORY
DIRECTORY
src/rpp
src/rppqt
DESTINATION
DESTINATION
"${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT
COMPONENT
RPP_Development
)

Expand Down Expand Up @@ -41,12 +41,12 @@ configure_package_config_file(cmake/install-config.cmake.in "${package}Config.cm
)

install(
FILES
"${PROJECT_BINARY_DIR}/${package}Config.cmake"
FILES
"${PROJECT_BINARY_DIR}/${package}Config.cmake"
"${PROJECT_BINARY_DIR}/${package}ConfigVersion.cmake"
DESTINATION
DESTINATION
"${RPP_INSTALL_CMAKEDIR}"
COMPONENT
COMPONENT
RPP_Development
)

Expand Down
2 changes: 1 addition & 1 deletion cmake/lint-targets.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(
FORMAT_PATTERNS
src/*.cpp
src/*.cpp
src/*.hpp
CACHE STRING
"; separated patterns relative to the project source dir to format"
Expand Down
Loading