@@ -151,17 +151,18 @@ ROOT::RFieldDescriptor::CreateField(const RNTupleDescriptor &ntplDesc, const ROO
151151
152152bool ROOT::RFieldDescriptor::IsCustomClass () const
153153{
154- if (fStructure != ROOT::ENTupleStructure::kRecord && fStructure != ROOT::ENTupleStructure::kStreamer )
154+ if (GetStructure () != ROOT::ENTupleStructure::kRecord && GetStructure () != ROOT::ENTupleStructure::kStreamer ) {
155155 return false ;
156+ }
156157
157158 // Skip untyped structs
158- if (fTypeName .empty ())
159+ if (GetTypeName () .empty ())
159160 return false ;
160161
161- if (fStructure == ROOT::ENTupleStructure::kRecord ) {
162- if (fTypeName .compare (0 , 10 , " std::pair<" ) == 0 )
162+ if (GetStructure () == ROOT::ENTupleStructure::kRecord ) {
163+ if (GetTypeName () .compare (0 , 10 , " std::pair<" ) == 0 )
163164 return false ;
164- if (fTypeName .compare (0 , 11 , " std::tuple<" ) == 0 )
165+ if (GetTypeName () .compare (0 , 11 , " std::tuple<" ) == 0 )
165166 return false ;
166167 }
167168
@@ -170,27 +171,12 @@ bool ROOT::RFieldDescriptor::IsCustomClass() const
170171
171172bool ROOT::RFieldDescriptor::IsCustomEnum (const RNTupleDescriptor &desc) const
172173{
173- if (fStructure != ROOT::ENTupleStructure::kPlain )
174- return false ;
175- if (fTypeName .rfind (" std::" , 0 ) == 0 )
176- return false ;
177-
178- auto subFieldId = desc.FindFieldId (" _0" , fFieldId );
179- if (subFieldId == kInvalidDescriptorId )
180- return false ;
181-
182- static const std::string gIntTypeNames [] = {" bool" , " char" , " std::int8_t" , " std::uint8_t" ,
183- " std::int16_t" , " std::uint16_t" , " std::int32_t" , " std::uint32_t" ,
184- " std::int64_t" , " std::uint64_t" };
185- return std::find (std::begin (gIntTypeNames ), std::end (gIntTypeNames ),
186- desc.GetFieldDescriptor (subFieldId).GetTypeName ()) != std::end (gIntTypeNames );
174+ return Internal::IsCustomEnumFieldDesc (desc, *this );
187175}
188176
189177bool ROOT::RFieldDescriptor::IsStdAtomic () const
190178{
191- if (fStructure != ROOT::ENTupleStructure::kPlain )
192- return false ;
193- return (fTypeName .rfind (" std::atomic<" , 0 ) == 0 );
179+ return Internal::IsStdAtomicFieldDesc (*this );
194180}
195181
196182// //////////////////////////////////////////////////////////////////////////////
@@ -1507,3 +1493,28 @@ ROOT::Experimental::RNTupleAttrSetDescriptor ROOT::Experimental::RNTupleAttrSetD
15071493 desc.fName = fName ;
15081494 return desc;
15091495}
1496+
1497+ bool ROOT::Internal::IsCustomEnumFieldDesc (const RNTupleDescriptor &desc, const RFieldDescriptor &fieldDesc)
1498+ {
1499+ if (fieldDesc.GetStructure () != ROOT::ENTupleStructure::kPlain )
1500+ return false ;
1501+ if (fieldDesc.GetTypeName ().rfind (" std::" , 0 ) == 0 )
1502+ return false ;
1503+
1504+ auto subFieldId = desc.FindFieldId (" _0" , fieldDesc.GetId ());
1505+ if (subFieldId == kInvalidDescriptorId )
1506+ return false ;
1507+
1508+ static const std::string gIntTypeNames [] = {" bool" , " char" , " std::int8_t" , " std::uint8_t" ,
1509+ " std::int16_t" , " std::uint16_t" , " std::int32_t" , " std::uint32_t" ,
1510+ " std::int64_t" , " std::uint64_t" };
1511+ return std::find (std::begin (gIntTypeNames ), std::end (gIntTypeNames ),
1512+ desc.GetFieldDescriptor (subFieldId).GetTypeName ()) != std::end (gIntTypeNames );
1513+ }
1514+
1515+ bool ROOT::Internal::IsStdAtomicFieldDesc (const RFieldDescriptor &fieldDesc)
1516+ {
1517+ if (fieldDesc.GetStructure () != ROOT::ENTupleStructure::kPlain )
1518+ return false ;
1519+ return (fieldDesc.GetTypeName ().rfind (" std::atomic<" , 0 ) == 0 );
1520+ }
0 commit comments