Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add non-const getter for Collections in EventStore #95

Closed
wants to merge 1 commit into from

Conversation

vvolkl
Copy link
Contributor

@vvolkl vvolkl commented Jun 9, 2020

Fixes #94

BEGINRELEASENOTES

  • add non-const getter for Collections in EventStore

ENDRELEASENOTES

Copy link
Contributor

@gaede gaede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it maybe be nicer to add the following method instead:

/// access to non-const pointer that allows modifying the collection
template<typename T>
T* EventStore::get(const std::string& name) 

this requires less typing ...

@hegner
Copy link
Collaborator

hegner commented Jun 16, 2020

I find such syntax quite dangerous. If mixing a const T& and T* interface of the otherwise same signature, I can see sloppiness and usage of the T* version raise drastically. Which is bad for thread-safety.
Anyhow, I just realised that somehow the const-handling of the interface does not seem consistent at other places. Should we make that a discussion topic?

@gaede
Copy link
Contributor

gaede commented Jun 23, 2020

As discussed in the EDM4hep meeting, we postpone this PR until we have a better understanding of the needed semantics of the EventStore API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EventStore: better way to keep track of collections used for writing
3 participants