Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* feat: for scikit-hep/uproot5#1229

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
veprbl and pre-commit-ci[bot] authored Jul 16, 2024
1 parent 60d16e7 commit 9ce1f2b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions dev/make-root/uproot_issue_1229.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <TFile.h>
#include <TObject.h>
#include <TTree.h>

class TFooMember : public TObject {
public:
TFooMember(int _value)
: value(_value)
{};

int value;

ClassDef(TFooMember, 1);
};

class TFoo : public TObject {
public:
TFoo(int value_for_member, int value_for_const_member)
: pointer{new TFooMember(value_for_member)}
, const_pointer{new TFooMember(value_for_const_member)}
{};

TFooMember *pointer;
const TFooMember *const_pointer;

ClassDef(TFoo, 1);
};

// Streaming interpreted classes is not supported, so this has to be ran with ACLiC:
//
// root -lbq uproot_issue_1229.C+
//
void uproot_issue_1229() {
TFile f("uproot-issue-1229.root", "RECREATE");
TTree tree;
TFoo foo(123, 321);
tree.Branch("branch", &foo);
tree.Fill();
tree.Write("tree");
}
Binary file added src/skhep_testdata/data/uproot-issue-1229.root
Binary file not shown.

0 comments on commit 9ce1f2b

Please sign in to comment.