forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
[IO][VecOps] Allow dictionaries for vector<bool, A> and select by default RVec<bool> and RVec<bool>::Impl in the linkdef #3
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
Closed
Closed
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0cfa1c8
[DF][NFC] Update variable name tvec -> rvec
eguiraud b30bcc6
[DF] Remove unnecessary line from RColumnValue
eguiraud db9806a
[DF][NFC] Better name for variable
eguiraud 49cd083
[DF][NFC] Improve a comment on vector<bool>
eguiraud dd96496
[DF][NFC] Move comments to a better position
eguiraud f0cfb7c
[DF][NFC] Differentiate clearly between function call and ctor
eguiraud 2526578
[DF][NFC] Better names for variables
eguiraud 1aa3970
[DF][NFC] Make change of state more obvious
eguiraud 7d90bcf
[DF] Always copy from TTreeReaderArray<bool> into RVec<bool>
eguiraud 2a70670
[DF] Test reading of std::vector<bool>, bool[]
eguiraud ccbf235
[DF] Test snapshot of variable size arrays with wildly changing sizes
eguiraud 2c30bc2
[DF] Add tests for Snapshotting of vectors/arrays of bool
eguiraud c2846f2
[DF][NFC] const-correctness
eguiraud 4c867e5
[DF] Fix writing of arrays of bools via Snapshot
eguiraud 8bee625
[TOREVERT] Disable Snapshot<RVec<bool>> in test for now
eguiraud 40584d3
[IO] TCollectionProxyInfo::Type allow specialisations for vector<bool…
dpiparo 2894465
[VecOps] Add selections for RVec<bool> and RVec<bool>::Impl by default.
dpiparo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,24 @@ template <typename T> class TStdBitsetHelper { | |
| } | ||
|
|
||
| namespace Detail { | ||
|
|
||
| // Detect whether a type is an instantiation of vector<T,A> | ||
| // We need to use a custom type and not an integral constant such as std::true/false_type as mother classes | ||
| // because a type of specialized non-type template argument cannot depend on a template parameter of the | ||
| // partial specialization | ||
| struct VectorBoolTrue{}; | ||
| struct VectorBoolFalse{}; | ||
|
|
||
| template <typename> | ||
| struct IsVectorBool_t{ | ||
| using value = VectorBoolFalse; | ||
| }; | ||
|
|
||
| template <typename A> | ||
| struct IsVectorBool_t<std::vector<bool, A>>{ | ||
| using value = VectorBoolTrue; | ||
| }; | ||
|
|
||
| class TCollectionProxyInfo { | ||
| // This class is a place holder for the information needed | ||
| // to create the proper Collection Proxy. | ||
|
|
@@ -281,7 +299,7 @@ namespace Detail { | |
| * @version 1.0 | ||
| * @date 10/10/2004 | ||
| */ | ||
| template <class T> struct Type | ||
| template <class T, class V = typename IsVectorBool_t<T>::value> struct Type | ||
| : public Address<TYPENAME T::const_reference> | ||
| { | ||
| typedef T Cont_t; | ||
|
|
@@ -613,16 +631,18 @@ namespace Detail { | |
|
|
||
| }; | ||
|
|
||
| template <> struct TCollectionProxyInfo::Type<std::vector<Bool_t> > | ||
| : public TCollectionProxyInfo::Address<std::vector<Bool_t>::const_reference> | ||
| // This specialization is chosen if T is a vector<bool, A>, irrespective of the nature | ||
| // of the allocator A represents. | ||
| template <class T> struct TCollectionProxyInfo::Type<T, VectorBoolTrue> | ||
| : public TCollectionProxyInfo::Address<typename T::const_reference> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would something like this simplify the |
||
| { | ||
| typedef std::vector<Bool_t> Cont_t; | ||
| typedef std::vector<Bool_t>::iterator Iter_t; | ||
| typedef std::vector<Bool_t>::value_type Value_t; | ||
| typedef Environ<Iter_t> Env_t; | ||
| typedef Env_t *PEnv_t; | ||
| typedef Cont_t *PCont_t; | ||
| typedef Value_t *PValue_t; | ||
| typedef T Cont_t; | ||
| typedef typename T::iterator Iter_t; | ||
| typedef typename T::value_type Value_t; | ||
| typedef Environ<Iter_t> Env_t; | ||
| typedef Env_t *PEnv_t; | ||
| typedef Cont_t *PCont_t; | ||
| typedef Value_t *PValue_t; | ||
|
|
||
| virtual ~Type() {} | ||
|
|
||
|
|
@@ -675,7 +695,7 @@ namespace Detail { | |
| //typedef Iterators<Cont_t,fgLargeIterator> Iterators_t; | ||
|
|
||
| struct Iterators { | ||
| typedef Cont_t::iterator iterator; | ||
| typedef typename Cont_t::iterator iterator; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this |
||
|
|
||
| static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy*) { | ||
| PCont_t c = PCont_t(coll); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
would this work? https://godbolt.org/z/TNDPQI