Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • Corryvreckan Corryvreckan
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 38
    • Issues 38
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CorryvreckanCorryvreckan
  • CorryvreckanCorryvreckan
  • Merge requests
  • !155

Rewritten Clipboard & FileReader/Writer Modules

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Simon Spannagel requested to merge clipboard into master Aug 25, 2019
  • Overview 40
  • Commits 78
  • Pipelines 19
  • Changes 77

This MR includes a complete rewrite of the Clipboard and the FileReader and FileWriter modules.

Clipboard

The new clipboard storage does not store data types as strings, i.e. no string comparison is necessary and the requirement to the rather ugly reinterpret_cast calls has been removed. The new interface is templated and allows to simply put and retrieve data like

// Store pixel data on the clipboard:
auto pixels = std::make_shared<PixelVector>();
clipboard->put(pixels, detector->name());

// Retrieve cluster data from the clipboard:
auto clusters = clipboard->get<Cluster>(detector->name());

which greatly improves usability and also allows for later changes such as the removal of raw pointers as internal storage.

FileReader & FileWriter

The rewrite of the clipboard but also the evolving framework itself made it necessary to revamp the reader and writer modules. The current modules for example cannot interpret, read or write Event objects on the clipboard - which has been an integral part of the framework for a while now.

The new modules are much more flexible in terms of what data they can store/read and they do not require cumbersome factory functions but rather use a creator map and a SFINAE trick to create objects of the desired type and to put them onto the clipboard.

The functionality has been tested using the TextWriter module by reading in raw data using event loader modules, storing the result with the FileWriter and TextWriter, reading it back in with the FileReader and storing it again with the TextWriter. The two resulting text files are equivalent.

Currently the test reading a simulation fails because the underlying file format is that of the old FileReader module.

Compatibility

This MR breaks backwards compatibility with any files written using the old FileWriter module. They cannot be read back into the system and maintaining compatibility would be a major undertaking. I would vote for breaking compatibility here, especially since we are still before an "officially released" version 1.0.

This closes !125 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: clipboard