-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.