Skip to content

[rfile] Further cleanups + allow setting object titles - #23811

Merged
dpiparo merged 9 commits into
root-project:masterfrom
silverweed:rfile_cleanups3
Oct 28, 2026
Merged

dpiparo merged 9 commits into
root-project:masterfrom
silverweed:rfile_cleanups3

Conversation

@silverweed

Copy link
Copy Markdown
Contributor

This Pull request:

Is the same as #23807 but without the TNamed-specific changes (will be a separate PR)
Adds some changes+fixes to RFile.

Changes or fixes:

  • allow setting objects' titles through Put
  • Replaced bool arg of Overwrite with bitmask for improved readability/expandability
  • Pythonized Overwrite so you can use keyword args instead of the bitmask
  • added tests
  • fixed bug in pythonized Get which didn't consider the cycle when getting the object.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Test Results

    24 files      24 suites   4d 3h 12m 22s ⏱️
 3 899 tests  3 899 ✅ 0 💤 0 ❌
83 482 runs  83 482 ✅ 0 💤 0 ❌

Results for commit e5ee553.

♻️ This comment has been updated with latest results.

@vepadulano vepadulano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread io/io/inc/ROOT/RFile.hxx Resolved
It seems that on mac15 x86 assertRaises doesn't work consistently.
We disable the test on that platform for now.
@dpiparo dpiparo modified the milestones: 6.42.00, 6.42.00-rc1 Oct 28, 2026
@dpiparo
dpiparo merged commit 851b66b into root-project:master Oct 28, 2026
34 of 36 checks passed
Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *option="", Int_t bufsize=0) override;
Int_t WriteObjectAny(const void *obj, const char *classname, const char *name, Option_t *option="", Int_t bufsize=0) override;
Int_t WriteObjectAny(const void *obj, const TClass *cl, const char *name, Option_t *option="", Int_t bufsize=0) override;
Int_t WriteObjectAny(const void *obj, const char *title, const TClass *cl, const char *name, Option_t *option="", Int_t bufsize=0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see why we choose this order of argument but at the same time it is a bit unnatural since we have semantically this order:

essential_arg1, decorative_arg, essential_arg2, essential_arg3, optional_behavior_changing_arg1, optional_behavior_changing_arg2).

An alternative could be:

Int_t       WriteObjectAny(const void *obj, const TClass *cl, std::pair<const char *, const char *> name_and_title, Option_t *option="", Int_t bufsize=0);

which the usage being only a bit unusual:

dir->WriteObjAny(pointer, cl, { name, title } );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants