Skip to content

Latest commit

 

History

History
158 lines (149 loc) · 13.4 KB

FEATURES_USED.md

File metadata and controls

158 lines (149 loc) · 13.4 KB

STL

  • std::deque used by default in CachedResource
  • std::list used by default in FCachedResource
  • std::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 and std::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

Language

RTTI

  • 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

Operator Overloading

  • Couldn't find much use for it, we have an overloaded += to add new tests in TestBase

Networking(Socket Programming)

  • Made use of Qt's helpers for TCP sockets/servers:

Qt's signals and slots allowed for a very clean implementation.

Design Patterns

  • 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

Extra

  • 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 calling cmake
  • 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