-
Notifications
You must be signed in to change notification settings - Fork 27
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
PodioInput: Read all collections by default, allow to limit them with the collections
property
#162
Conversation
012c455
to
54324c3
Compare
const auto& collsToRead = [&]() { | ||
if (m_collectionNames.empty()) { | ||
return m_podioDataSvc->getEventFrame().getAvailableCollections(); | ||
} else { | ||
return m_collectionNames.value(); | ||
} | ||
}(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my c++ knowledge is not as advanced but why do we need this as a lambda? 🥴
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern is called an immediately invoked function expression (IIFE) and it is mainly used for "complicated" initialization logic, where it can help to
- reduce the scope of temporary variables that are necessary for the initialization
- Allows to declare the initialized object as
const
, instead of having it mutable and dealing with the logic outside.
So in this case really only to have a const&
instead of just a &
.
0b7e4b9
to
9e4fde6
Compare
9e4fde6
to
f8c7325
Compare
Implemented the reading of the collections from the command line via the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
f8c7325
to
da8ba07
Compare
BEGINRELEASENOTES
collections
property to allow limiting the collections that are read to a subset of collections.ENDRELEASENOTES
Partially addresses #105