diff --git a/core/foundation/inc/ROOT/RConfig.hxx b/core/foundation/inc/ROOT/RConfig.hxx index 957d5c9bf6301..5d45aebd656c5 100644 --- a/core/foundation/inc/ROOT/RConfig.hxx +++ b/core/foundation/inc/ROOT/RConfig.hxx @@ -491,6 +491,14 @@ #define _R__DEPRECATED_640(REASON) _R_DEPRECATED_REMOVE_NOW(REASON) #endif +/* USE AS `R__DEPRECATED(6,42, "Not threadsafe; use TFoo::Bar().")` + To be removed by 6.42 */ +#if ROOT_VERSION_CODE <= ROOT_VERSION(6, 41, 0) +#define _R__DEPRECATED_642(REASON) _R__DEPRECATED_LATER(REASON) +#else +#define _R__DEPRECATED_642(REASON) _R_DEPRECATED_REMOVE_NOW(REASON) +#endif + /* USE AS `R__DEPRECATED(7,00, "Not threadsafe; use TFoo::Bar().")` To be removed by 7.00 */ #if ROOT_VERSION_CODE < ROOT_VERSION(6,99,0) diff --git a/tree/ntuple/inc/ROOT/RField.hxx b/tree/ntuple/inc/ROOT/RField.hxx index a0243d8dee4c6..b342fd6895724 100644 --- a/tree/ntuple/inc/ROOT/RField.hxx +++ b/tree/ntuple/inc/ROOT/RField.hxx @@ -71,7 +71,7 @@ public: /// future RNTuple versions (e.g. an unknown Structure) class RInvalidField final : public RFieldBase { public: - enum class RCategory { + enum class ECategory { /// Generic unrecoverable error kGeneric, /// The type given to RFieldBase::Create was invalid @@ -82,9 +82,11 @@ public: kUnknownStructure, }; + using RCategory R__DEPRECATED(6, 42, "enum renamed to ECategory") = ECategory; + private: std::string fError; - RCategory fCategory; + ECategory fCategory; protected: std::unique_ptr CloneImpl(std::string_view newName) const final @@ -94,14 +96,14 @@ protected: void ConstructValue(void *) const final {} public: - RInvalidField(std::string_view name, std::string_view type, std::string_view error, RCategory category) + RInvalidField(std::string_view name, std::string_view type, std::string_view error, ECategory category) : RFieldBase(name, type, ROOT::ENTupleStructure::kLeaf, false /* isSimple */), fError(error), fCategory(category) { fTraits |= kTraitInvalidField; } const std::string &GetError() const { return fError; } - RCategory GetCategory() const { return fCategory; } + ECategory GetCategory() const { return fCategory; } size_t GetValueSize() const final { return 0; } size_t GetAlignment() const final { return 0; } @@ -214,7 +216,7 @@ private: TClass *fClass = nullptr; ROOT::Internal::RNTupleSerializer::StreamerInfoMap_t fStreamerInfos; ///< streamer info records seen during writing - ROOT::Internal::RColumnIndex fIndex; ///< number of bytes written in the current cluster + ROOT::Internal::RColumnIndex fIndex; ///< number of bytes written in the current cluster private: RStreamerField(std::string_view fieldName, TClass *classp); diff --git a/tree/ntuple/src/RFieldBase.cxx b/tree/ntuple/src/RFieldBase.cxx index 43e7668a52a60..6ceac304c3009 100644 --- a/tree/ntuple/src/RFieldBase.cxx +++ b/tree/ntuple/src/RFieldBase.cxx @@ -305,8 +305,8 @@ ROOT::RFieldBase::Create(const std::string &fieldName, const std::string &typeNa auto fnFail = [&fieldName, &resolvedType](const std::string &errMsg, - RInvalidField::RCategory cat = - RInvalidField::RCategory::kTypeError) -> RResult> { + RInvalidField::ECategory cat = + RInvalidField::ECategory::kTypeError) -> RResult> { if (createContext.GetContinueOnError()) { return std::unique_ptr(std::make_unique(fieldName, resolvedType, errMsg, cat)); } else { @@ -603,7 +603,7 @@ ROOT::RFieldBase::Create(const std::string &fieldName, const std::string &typeNa auto error = e.GetError(); if (createContext.GetContinueOnError()) { return std::unique_ptr(std::make_unique(fieldName, typeName, error.GetReport(), - RInvalidField::RCategory::kGeneric)); + RInvalidField::ECategory::kGeneric)); } else { return error; } @@ -611,7 +611,7 @@ ROOT::RFieldBase::Create(const std::string &fieldName, const std::string &typeNa // Integer parsing error if (createContext.GetContinueOnError()) { return std::unique_ptr( - std::make_unique(fieldName, typeName, e.what(), RInvalidField::RCategory::kGeneric)); + std::make_unique(fieldName, typeName, e.what(), RInvalidField::ECategory::kGeneric)); } else { return R__FAIL(e.what()); } @@ -624,7 +624,7 @@ ROOT::RFieldBase::Create(const std::string &fieldName, const std::string &typeNa } return result; } - return R__FORWARD_RESULT(fnFail("unknown type: " + typeName, RInvalidField::RCategory::kUnknownType)); + return R__FORWARD_RESULT(fnFail("unknown type: " + typeName, RInvalidField::ECategory::kUnknownType)); } const ROOT::RFieldBase::RColumnRepresentations &ROOT::RFieldBase::GetColumnRepresentations() const diff --git a/tree/ntuple/src/RNTupleDescriptor.cxx b/tree/ntuple/src/RNTupleDescriptor.cxx index 329c48467496d..982319045a0dd 100644 --- a/tree/ntuple/src/RNTupleDescriptor.cxx +++ b/tree/ntuple/src/RNTupleDescriptor.cxx @@ -81,7 +81,7 @@ ROOT::RFieldDescriptor::CreateField(const RNTupleDescriptor &ntplDesc, const ROO if (GetStructure() == ROOT::ENTupleStructure::kUnknown) { if (options.GetReturnInvalidOnError()) { auto invalidField = std::make_unique(GetFieldName(), GetTypeName(), "", - ROOT::RInvalidField::RCategory::kUnknownStructure); + ROOT::RInvalidField::ECategory::kUnknownStructure); invalidField->SetOnDiskId(fFieldId); return invalidField; } else { @@ -144,7 +144,7 @@ ROOT::RFieldDescriptor::CreateField(const RNTupleDescriptor &ntplDesc, const ROO } catch (const RException &ex) { if (options.GetReturnInvalidOnError()) return std::make_unique(GetFieldName(), GetTypeName(), ex.GetError().GetReport(), - ROOT::RInvalidField::RCategory::kGeneric); + ROOT::RInvalidField::ECategory::kGeneric); else throw ex; } @@ -702,7 +702,7 @@ std::unique_ptr ROOT::RNTupleDescriptor::CreateModel(const R if (field->GetTraits() & ROOT::RFieldBase::kTraitInvalidField) { const auto &invalid = static_cast(*field); const auto cat = invalid.GetCategory(); - bool mustThrow = cat != RInvalidField::RCategory::kUnknownStructure; + bool mustThrow = cat != RInvalidField::ECategory::kUnknownStructure; if (mustThrow) throw invalid.GetError();