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

EventStore: better way to keep track of collections used for writing #94

Closed
Tracked by #109
vvolkl opened this issue May 29, 2020 · 1 comment
Closed
Tracked by #109

Comments

@vvolkl
Copy link
Contributor

vvolkl commented May 29, 2020

The EventStore currently has two methods to access it's collections by name:

    /// access a collection by name. returns true if successful
    template<typename T>
    bool get(const std::string& name, const T*& collection);
    /// access a collection by name
    /// returns a collection w/ setting isValid to true if successful
    template<typename T>
    const T& get(const std::string& name );

That's not really ideal when trying to create collections from an external datasource where it is not known how many / which collections there are at compile time. In this case, ideally I would create branches according to what the external datasource provides and keep track of the collections in a map: branchname -> collectionptr.

The const pointer cannot be used for this purpose, as I cannot call create in the next step of filling the branches in the event loop. And dealing with maps involving references is quite painful - maybe it's possible but I haven't figured it out. I managed to implement the same thing with a vector of references, but would then have to do a lot more bookkeeping. Simply adding a getter for non-const pointers seems like the easiest way.

@tmadlener
Copy link
Collaborator

Closing since the EventStore based approach is deprecated.

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 a pull request may close this issue.

2 participants