@@ -150,11 +150,9 @@ protected:
150
150
ROOT::Internal::RColumnIndex fNWritten ;
151
151
152
152
// / Constructor used when the value type of the collection is not known in advance, i.e. in the case of custom
153
- // / collections.
153
+ // / collections. Note that this constructor requires manual initialization of the item field
154
+ // / (Attach() and setting fItemSize)
154
155
RProxiedCollectionField (std::string_view fieldName, TClass *classp);
155
- // / Constructor used when the value type of the collection is known in advance, e.g. in RSetField.
156
- RProxiedCollectionField (std::string_view fieldName, std::string_view typeName,
157
- std::unique_ptr<RFieldBase> itemField);
158
156
159
157
std::unique_ptr<RFieldBase> CloneImpl (std::string_view newName) const final ;
160
158
const RColumnRepresentations &GetColumnRepresentations () const final ;
@@ -364,7 +362,13 @@ public:
364
362
// / The generic field for a `std::set<Type>` and `std::unordered_set<Type>`
365
363
class RSetField : public RProxiedCollectionField {
366
364
public:
367
- RSetField (std::string_view fieldName, std::string_view typeName, std::unique_ptr<RFieldBase> itemField);
365
+ enum class ESetType {
366
+ kSet ,
367
+ kUnorderedSet ,
368
+ kMultiSet ,
369
+ kUnorderedMultiSet
370
+ };
371
+ RSetField (std::string_view fieldName, ESetType setType, std::unique_ptr<RFieldBase> itemField);
368
372
RSetField (RSetField &&other) = default ;
369
373
RSetField &operator =(RSetField &&other) = default ;
370
374
~RSetField () override = default ;
@@ -375,7 +379,7 @@ class RField<std::set<ItemT>> final : public RSetField {
375
379
public:
376
380
static std::string TypeName () { return " std::set<" + RField<ItemT>::TypeName () + " >" ; }
377
381
378
- explicit RField (std::string_view name) : RSetField(name, TypeName() , std::make_unique<RField<ItemT>>(" _0" )) {}
382
+ explicit RField (std::string_view name) : RSetField(name, ESetType:: kSet , std::make_unique<RField<ItemT>>(" _0" )) {}
379
383
RField (RField &&other) = default ;
380
384
RField &operator =(RField &&other) = default ;
381
385
~RField () final = default ;
@@ -386,7 +390,10 @@ class RField<std::unordered_set<ItemT>> final : public RSetField {
386
390
public:
387
391
static std::string TypeName () { return " std::unordered_set<" + RField<ItemT>::TypeName () + " >" ; }
388
392
389
- explicit RField (std::string_view name) : RSetField(name, TypeName(), std::make_unique<RField<ItemT>>(" _0" )) {}
393
+ explicit RField (std::string_view name)
394
+ : RSetField(name, ESetType::kUnorderedSet , std::make_unique<RField<ItemT>>(" _0" ))
395
+ {
396
+ }
390
397
RField (RField &&other) = default ;
391
398
RField &operator =(RField &&other) = default ;
392
399
~RField () final = default ;
@@ -397,7 +404,9 @@ class RField<std::multiset<ItemT>> final : public RSetField {
397
404
public:
398
405
static std::string TypeName () { return " std::multiset<" + RField<ItemT>::TypeName () + " >" ; }
399
406
400
- explicit RField (std::string_view name) : RSetField(name, TypeName(), std::make_unique<RField<ItemT>>(" _0" )) {}
407
+ explicit RField (std::string_view name) : RSetField(name, ESetType::kMultiSet , std::make_unique<RField<ItemT>>(" _0" ))
408
+ {
409
+ }
401
410
RField (RField &&other) = default ;
402
411
RField &operator =(RField &&other) = default ;
403
412
~RField () final = default ;
@@ -408,7 +417,10 @@ class RField<std::unordered_multiset<ItemT>> final : public RSetField {
408
417
public:
409
418
static std::string TypeName () { return " std::unordered_multiset<" + RField<ItemT>::TypeName () + " >" ; }
410
419
411
- explicit RField (std::string_view name) : RSetField(name, TypeName(), std::make_unique<RField<ItemT>>(" _0" )) {}
420
+ explicit RField (std::string_view name)
421
+ : RSetField(name, ESetType::kUnorderedMultiSet , std::make_unique<RField<ItemT>>(" _0" ))
422
+ {
423
+ }
412
424
RField (RField &&other) = default ;
413
425
RField &operator =(RField &&other) = default ;
414
426
~RField () final = default ;
0 commit comments