MultiRegionSetFields.C
Dear Fellows
I am looking at multiRegionSetFields.C file inside OF and there are some lines that I can not understand. The followings start from line 129: Code:
class iNew In the above , the class iNew has two constant private objects (mesh_ and selectedCells_) from fvMesh and labelList classes and a constructor (iNew) which has mesh and selectedCells as input arguments. However what is that ":" and these two lines: Code:
: Why fvMesh and labelList classes are defined as References: Code:
const fvMesh& mesh_; |
Dear Fellows
I figured out my first question answer. that Code:
: mesh_(mesh), selectedCells_(selectedCells) Code:
mesh_=mesh; Why fvMesh and labelList classes are defined as References: Code:
const fvMesh& mesh_; |
Quote:
Quote:
|
Thanks Sergei.
Just for clarifying: HTML Code:
Because when you construct an abject of this class you want these member variables to point to the existing objects not to create new ones, right. If they were not references but values then the constructor would have to create new copies. Code:
const fvMesh& mesh_; |
I believe mesh_ and selectedCells_ are called "member variables" and they are part of an object of iNew class. The word "variable" might imply that it can vary or be modified, but no, variable can be constant as well. And to confuse you even more, member variables are objects at the same time ;)
|
All times are GMT -4. The time now is 09:53. |