Comments (4)
You are right. I don't see a reason to not be consistent here. This should be fairly straight forward to fix, I think as these are directly passed to the underlying std::deque
, e.g.
podio/python/templates/Collection.cc.jinja2
Lines 39 to 41 in f4c9219
Out of of curiosity: Does something change with c++20 in this respect? I am asking since you mentioned it explicitly.
from podio.
According to cppreference.com it's effectively size_type
no matter the version:
Also, std::deque::operator[]
and std::deque::size()
use size_type
:
Since vector
and deque
both use std::allocator
by default, where size_type
is std::size_t
, I would assume vector::size_type
is the same as deque::size_type
(reference SO thread).
from podio.
I'm also now wondering if we should switch to size_t
for VectorMembers
and OneToManyRelations
, but at least for those the type is always unsigned int
. For example:
podio/python/templates/macros/declarations.jinja2
Lines 123 to 134 in f4c9219
Ultimately it looks like
Collection::size()
is the only odd one out, returning size_t
.from podio.
It also looks like we have a size_t
in the RelationRange
that is one of the returns above.
podio/include/podio/RelationRange.h
Lines 31 to 33 in f4c9219
For consistency with the usual c++ containers I think it would be good to have size_t
everywhere. From a purely functional point of view, it doesn't really matter probably, because the ObjectID
uses an int
internally at the moment, and that is essentially the limiting factor for the number of elements in a collection:
podio/include/podio/ObjectID.h
Lines 9 to 10 in f4c9219
from podio.
Related Issues (20)
- Make podio a (pip installable) python package
- PODIO_JSON_OUTPUT causes nlohmann/json.hpp in each include file, could be json_fwd.hpp instead HOT 1
- Podio collections are missing `empty()`, iterators missing `operator==()`
- Check podio Collections for C++ Container compatibility
- Frame based I/O crashes when reading objects with related object that were not persisted
- New python import structure does not work if SIO backend is not built HOT 2
- AddressSanitizer: heap-use-after-free in object destructor HOT 9
- Negative comparisons between `podio::ObjectID` objects are not implemented HOT 2
- Allow to limit the collections that are read
- ROOTFrameData leaks collection buffers that are not requested by the Frame HOT 2
- podio-vis not installed by make install HOT 2
- Cleanup CollectionReadBuffers HOT 1
- Weird names in `dir(podio)` HOT 1
- discussion: Possibility of differing in-memory and on-file datatypes HOT 1
- Add tests for JSON output
- Trivial return types of generated get methods should be by value instead of const reference
- Switch to black for formatting python sources HOT 1
- how to retrieve the cell ID encoding from the metadata in the output ROOT file HOT 2
- RNTuple interface changed in ROOT HOT 1
- collection push_back and value_type incompatible with some std iterator adaptors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from podio.