Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated class member names in ROOT classes #8189

Open
linev opened this issue May 17, 2021 · 8 comments
Open

Duplicated class member names in ROOT classes #8189

linev opened this issue May 17, 2021 · 8 comments
Assignees
Labels

Comments

@linev
Copy link
Member

linev commented May 17, 2021

There is fLineStyle member in TStyle class:

TString       fLineStyle[30];     ///< String describing line style i (for postScript)

At the same time there is fLineStyle in TAttLine class, which also base class for TStyle.

It makes problem to create JSON for such object - see #8181.
But also can make troubles in the future while:

root [0] TClass::GetClass("TStyle")->GetDataMemberOffset("fLineStyle")
(long) 74

This is offset for member from TAttLine class, but not from TStyle class.
Any attempt to write conversion I/O rules for such member fails because of this.

@linev
Copy link
Member Author

linev commented May 18, 2021

For completeness - here other ROOT classes with similar problem:

class: RooAbsOptTestStatistic member: _projDeps found also in class RooAbsTestStatistic
class: RooAbsPdf member: _selectComp found also in class RooAbsReal
class: TStyle member: fLineStyle found also in class TAttLine
class: TGeoOpticalSurface member: fName found also in class TNamed
class: RooUnblindOffset member: _value found also in class RooAbsHiddenReal
class: RooUnblindPrecision member: _value found also in class RooAbsHiddenReal
class: RooIntegralMorph::MorphCacheElem member: _nset found also in class RooAbsCachedPdf::PdfCacheElem
class: TMVA::DataLoader member: fOptions found also in class TMVA::Configurable
class: TGeoPatternHoneycomb member: fNdivisions found also in class TGeoPatternFinder
class: TGeoPatternHoneycomb member: fStart found also in class TGeoPatternFinder

@linev linev changed the title Duplicated fLineStyle data member in TStyle Duplicated class member names in ROOT classes May 18, 2021
@linev linev removed the in:Graphics label May 18, 2021
@couet
Copy link
Member

couet commented May 19, 2021

@linev I think you made a PR for that ? right ?

@linev
Copy link
Member Author

linev commented May 19, 2021

@couet I just provide workaround in TBufferJSON for TStyle class only.
I would prefer to change TStyle, but then it makes impossible to change older ROOT files where TStyle objects are stored.

@couet
Copy link
Member

couet commented May 19, 2021

so we can close this issue ?

@linev
Copy link
Member Author

linev commented May 19, 2021

No, it is not only TStyle.
One should try to resolve it for all other classes

@AdvaitDhingra
Copy link
Contributor

Can I give this a go?

@linev
Copy link
Member Author

linev commented May 25, 2021

Can I give this a go?

That do you mean?

For TStyle the only solution - workaround in TBufferJSON.

For other classes one should check if class members can be changed - to avoid any possible confusion in the future.

@AdvaitDhingra
Copy link
Contributor

Can I give this a go?

That do you mean?

For TStyle the only solution - workaround in TBufferJSON.

For other classes one should check if class members can be changed - to avoid any possible confusion in the future.

Ahh okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants