Kernel Development - Private or Protected in Header File? #117
Answered
by
cticenhour
ghost
asked this question in
Q&A Getting Started
Replies: 1 comment 4 replies
-
Within a given object, Private vs Protected doesn't really matter and is up
to the developer - this is why you see the mixed usage in Zapdos. These are
important, though, when it comes to objects that inherit from
FlowConvection in the future. Private means that those variables or methods
cannot be accessed outside of the class in any circumstance. Protected
means that variables or methods can be accessed by classes that inherit
from the class, but cannot be accessed by other classes.
|
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm developing the FlowConvection I've shared in some previous discussion posts to be AD. Currently, I'm looking at the header file and I see that there are two sections: protected and private with some variables, parameters, etc thrown under each. How does one decided where to put things?
I've looked through some of the kernels currently on Zapdos and I see a mixed bag. I've seen Real _r_units in protected and in private for example, and I've seen kernels without a private section at all. I looked through the GEC 2018 workshop slides but I didn't see anything that made it clear.
Any help would be greatly appreciated! I've finally set up a Zapdos fork, and I can enter the work-in-progress .h and .C files there if someone would like to view them.
Beta Was this translation helpful? Give feedback.
All reactions