Skip to content

Commit f7af6a4

Browse files
committed
[ntuple] rename RInvalidField::RCategory to ECategory
1 parent cce262c commit f7af6a4

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

tree/ntuple/inc/ROOT/RField.hxx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public:
7171
/// future RNTuple versions (e.g. an unknown Structure)
7272
class RInvalidField final : public RFieldBase {
7373
public:
74-
enum class RCategory {
74+
enum class ECategory {
7575
/// Generic unrecoverable error
7676
kGeneric,
7777
/// The type given to RFieldBase::Create was invalid
@@ -82,9 +82,11 @@ public:
8282
kUnknownStructure,
8383
};
8484

85+
using RCategory R__DEPRECATED(6, 40, "enum renamed to ECategory") = ECategory;
86+
8587
private:
8688
std::string fError;
87-
RCategory fCategory;
89+
ECategory fCategory;
8890

8991
protected:
9092
std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName) const final
@@ -94,14 +96,14 @@ protected:
9496
void ConstructValue(void *) const final {}
9597

9698
public:
97-
RInvalidField(std::string_view name, std::string_view type, std::string_view error, RCategory category)
99+
RInvalidField(std::string_view name, std::string_view type, std::string_view error, ECategory category)
98100
: RFieldBase(name, type, ROOT::ENTupleStructure::kLeaf, false /* isSimple */), fError(error), fCategory(category)
99101
{
100102
fTraits |= kTraitInvalidField;
101103
}
102104

103105
const std::string &GetError() const { return fError; }
104-
RCategory GetCategory() const { return fCategory; }
106+
ECategory GetCategory() const { return fCategory; }
105107

106108
size_t GetValueSize() const final { return 0; }
107109
size_t GetAlignment() const final { return 0; }
@@ -214,7 +216,7 @@ private:
214216

215217
TClass *fClass = nullptr;
216218
ROOT::Internal::RNTupleSerializer::StreamerInfoMap_t fStreamerInfos; ///< streamer info records seen during writing
217-
ROOT::Internal::RColumnIndex fIndex; ///< number of bytes written in the current cluster
219+
ROOT::Internal::RColumnIndex fIndex; ///< number of bytes written in the current cluster
218220

219221
private:
220222
RStreamerField(std::string_view fieldName, TClass *classp);

tree/ntuple/src/RFieldBase.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ ROOT::RFieldBase::Create(const std::string &fieldName, const std::string &typeNa
305305

306306
auto fnFail = [&fieldName,
307307
&resolvedType](const std::string &errMsg,
308-
RInvalidField::RCategory cat =
309-
RInvalidField::RCategory::kTypeError) -> RResult<std::unique_ptr<RFieldBase>> {
308+
RInvalidField::ECategory cat =
309+
RInvalidField::ECategory::kTypeError) -> RResult<std::unique_ptr<RFieldBase>> {
310310
if (createContext.GetContinueOnError()) {
311311
return std::unique_ptr<RFieldBase>(std::make_unique<RInvalidField>(fieldName, resolvedType, errMsg, cat));
312312
} else {
@@ -603,15 +603,15 @@ ROOT::RFieldBase::Create(const std::string &fieldName, const std::string &typeNa
603603
auto error = e.GetError();
604604
if (createContext.GetContinueOnError()) {
605605
return std::unique_ptr<RFieldBase>(std::make_unique<RInvalidField>(fieldName, typeName, error.GetReport(),
606-
RInvalidField::RCategory::kGeneric));
606+
RInvalidField::ECategory::kGeneric));
607607
} else {
608608
return error;
609609
}
610610
} catch (const std::logic_error &e) {
611611
// Integer parsing error
612612
if (createContext.GetContinueOnError()) {
613613
return std::unique_ptr<RFieldBase>(
614-
std::make_unique<RInvalidField>(fieldName, typeName, e.what(), RInvalidField::RCategory::kGeneric));
614+
std::make_unique<RInvalidField>(fieldName, typeName, e.what(), RInvalidField::ECategory::kGeneric));
615615
} else {
616616
return R__FAIL(e.what());
617617
}
@@ -624,7 +624,7 @@ ROOT::RFieldBase::Create(const std::string &fieldName, const std::string &typeNa
624624
}
625625
return result;
626626
}
627-
return R__FORWARD_RESULT(fnFail("unknown type: " + typeName, RInvalidField::RCategory::kUnknownType));
627+
return R__FORWARD_RESULT(fnFail("unknown type: " + typeName, RInvalidField::ECategory::kUnknownType));
628628
}
629629

630630
const ROOT::RFieldBase::RColumnRepresentations &ROOT::RFieldBase::GetColumnRepresentations() const

tree/ntuple/src/RNTupleDescriptor.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ ROOT::RFieldDescriptor::CreateField(const RNTupleDescriptor &ntplDesc, const ROO
8181
if (GetStructure() == ROOT::ENTupleStructure::kUnknown) {
8282
if (options.GetReturnInvalidOnError()) {
8383
auto invalidField = std::make_unique<ROOT::RInvalidField>(GetFieldName(), GetTypeName(), "",
84-
ROOT::RInvalidField::RCategory::kUnknownStructure);
84+
ROOT::RInvalidField::ECategory::kUnknownStructure);
8585
invalidField->SetOnDiskId(fFieldId);
8686
return invalidField;
8787
} else {
@@ -144,7 +144,7 @@ ROOT::RFieldDescriptor::CreateField(const RNTupleDescriptor &ntplDesc, const ROO
144144
} catch (const RException &ex) {
145145
if (options.GetReturnInvalidOnError())
146146
return std::make_unique<ROOT::RInvalidField>(GetFieldName(), GetTypeName(), ex.GetError().GetReport(),
147-
ROOT::RInvalidField::RCategory::kGeneric);
147+
ROOT::RInvalidField::ECategory::kGeneric);
148148
else
149149
throw ex;
150150
}
@@ -702,7 +702,7 @@ std::unique_ptr<ROOT::RNTupleModel> ROOT::RNTupleDescriptor::CreateModel(const R
702702
if (field->GetTraits() & ROOT::RFieldBase::kTraitInvalidField) {
703703
const auto &invalid = static_cast<const RInvalidField &>(*field);
704704
const auto cat = invalid.GetCategory();
705-
bool mustThrow = cat != RInvalidField::RCategory::kUnknownStructure;
705+
bool mustThrow = cat != RInvalidField::ECategory::kUnknownStructure;
706706
if (mustThrow)
707707
throw invalid.GetError();
708708

0 commit comments

Comments
 (0)