Comments (8)
It looks promising. I ran into the same root issues you did, but it looks like that it's because something expects proxy classes that need copy constructors. It looks like once I understand the code a bit more, I can do something that can work around the problem.
from podio.
For why the write
command gives warnings, see the comment in the test definition:
Lines 35 to 39 in 3d9f867
from podio.
Got it. I've gotten everything to work in the base case and things to fail in the non-copyable case. I'll spend a few days looking at the error messages to give some better diagnostics when things are broken.
from podio.
Took a quick look. What the problem seems to be is that ROOT contains generic templates to convert collection classes to and from STL vectors. Once you mark the copy constructor as non-existent that fails. Also, it really should fail, since if the object is really non-copyable then bad things will happen once you copy it.
Right now, I'm digging into the code to see if I can override the behavior and cause it to throw an exception if you try to do a copy. It looks possible, but it all involves giving out the right C++magic.
from podio.
Okay here is the problem.....
instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::Pushback< vector<ex42::ExampleWithNamespaceData> >()));
The system tries to create proxies for vectors of containers, and vectors inheritly require copy constructors to put items into the vector.
It's possible to have vectors without copies using emplace_back, but not sure how this is going to work.
Ideas?
from podio.
I think the easy thing to do is to disable the creation of vectors of collections, since it doesn't make sense to have a collection of collections. Does that work?
from podio.
Because I just ran into a related problem myself:
void doSomething(const WhateverCollection collection);
vs the probably intended
void doSomething(const WhateverCollection& collection);
Both compile fine, but the former fails with a rather cryptic error message during runtime:
malloc_consolidate(): invalid chunk size
So, I think having truly non-copyable collections would be extremely nice to catch such things early.
from podio.
I think the easy thing to do is to disable the creation of vectors of collections, since it doesn't make sense to have a collection of collections. Does that work?
I think that is a sensible suggestion. And if we remove that requirement we can actually remove the copy constructor and the copy assignment operator for collections. Currently we require that a vector<Collection>
is streamable with root in the selection.xml
that we generate. However, as far as I can tell, this is something we really do not need, since the only things we want to store in root files is vector<Data>
, since each collection goes into its own branch in any case. It is possible to significantly cut down on the contents of the selection.xml
, such that in the end only the
<class name="{{classname}}Data"/>
<class name="{{classname}}Collection"/>
are needed for all the generated classes. Interestingly the latter is necessary for a working python interface when building with gcc, but can be omitted when building with clang (and still have working python interface).
from podio.
Related Issues (20)
- 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
- Inconsistent reference access for Mutable types
- Schema evolution script does not flag some evolutions as impossible
- Frame serialization/deserialization HOT 12
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.