std::deque
used by default in CachedResourcestd::list
used by default in FCachedResourcestd::optional
used by DrawHistory to remember where the last drawn point was- C++17's
emplace_back
returning a reference to the emplaced object used in CachedLayers - Helpers from
<iterator>
used in CachedResource and FCachedResource:std::advance
std::distance
std::next
- C++14/17 type traits used in Tests:
std::remove_cv
std::remove_reference_t
std::is_same_v
- Multithreading utilities used in Tests to run tests in parallel:
std::atomic
std::thread
std::condition_variable
std::mutex
std::unique_lock
std::future
std::packaged_task
- C++17's
std::filesystem
used to iterate over test reports in Tests - C++17's
std::invoke
andstd::invoke_result_t
used to return the correct type in ThreadPool::push and to pass correct function call to thread pool workers std::unique_ptr
used in:std::shared_ptr
used in ThreadPool::push to correctly store the result of the given function
- Lambdas used for
reduceTo
in CachedResource - Trailing return types used basically everywhere
- Init statments in
if
used in:- DrawHistory in
handleExternal
andhandleLocal
- AbstractNetwork in
send*
functions
- DrawHistory in
- C++17's
[[nodiscard]]
used almost everywhere explicit
used for most constructorsnoexcept
move constructors and assignment operators whenever appropiate- C++17's nested namespace definition used for CachedLayers
- Anonymous namespaces used to define tests that do not conflict with other tests defined in different files but at the same line in Tests
constexpr
used for configuration in:- C++17's
inline
variables used in: - Templates used in:
static_assert
used in:- Variadic templates + fold expressions + perfect forwarding used to implement:
emplaceBack
in CachedResource and FCachedResourcesk::format
in FormatThreadPool::push
in Tests
- Abstract classes:
TestBase
in TestsAbstractNetwork
in abstract_network.hpp
- Exceptions used in Tests to check if a test is being pushed after termination(extends
std::exception
)
- Didn't really use it ourselves, but if you count Qt it's used almost everywhere to make use of signals and slots, mostly in Canvas and AbstractNetwork
- Couldn't find much use for it, we have an overloaded
+=
to add new tests in TestBase
- Made use of Qt's helpers for TCP sockets/servers:
Qt's signals and slots allowed for a very clean implementation.
- Client/Server: in Client and Server to create and maintain a peer-to-peer connection
- Factory: in NetworkFactory
- Singleton: in TestSingleton to manage test creation globally
- Command Pattern: in CachedResource and FCachedResource used to maintain history of insertions for undo/redo. Each modification to the canvas is stored as a separate image in a list(until the limit is reached, by default 100 images AKA 100 undos at most)
- Observer Pattern: in Canvas and AbstractNetwork if you count Qt's signals/slots
- QML used for declaring the user interface. All zooming/scrolling and all controls are implemented in QML, thus the UI and implementation are independent
- Clang-Tidy used to check for mistakes/improvements in code using scripts/run-clang-tidy.py
- Clang-Format used to format the code (and verify that the code is formatted according to
.clang-format
using scripts/run-clang-format.py) - Clazy used to check for common Qt mistakes/improvements in code using scripts/run-clazy.sh
- Modern CMake used to describe how the code should be built, making use of
EXPORT_COMPILE_COMMANDS
to get a compilation database for other tools to use cmake-format
is used to format all CMake files according to.cmake-format.yaml
using the scripts/run-cmake-format.sh- Addres, Leak, Undefined sanitizers are used to check for memory leaks and undefined behavior in code(found some nasty bugs with those! - for example incrementing invalidated iterators in FCachedResource)
- Code coverage can be generated by specifying
-DENABLE_COVERAGE=ON
when callingcmake
- All tests defined in tests/ are run with
ctest
by having-DENABLE_TESTS=ON
- Code is continuously checked/run with above tools/scripts in Github Actions on every push/pr
- Code is also deployed on windows with Github Actions and you can actually download binaries for windows directly in Releases