PtrList and List
Recently I have peered the OpenFOAM source codes to understand the data structures used in it.
Meanwhile, a fundamental question has come up : "why does the OpenFOAM frequently use PtrList instead of List?"
I think it may not be the case of OpenFOAM only but also C++ language.
One thing that I can guess is that it can handle large data efficiently by using the pointers instead of objects directly. But I don't have any other idea of advantages of using PtrList over List.
Please somebody help me with this problem!
Thank you very much.
In addition, OpenFOAM uses pointers a lot, so much that it has the "tmp" mechanism: http://openfoamwiki.net/index.php/OpenFOAM_guide/tmp
|All times are GMT -4. The time now is 02:15.|