CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   OpenFOAM smart pointers and Dependency Injection (https://www.cfd-online.com/Forums/openfoam-programming-development/237422-openfoam-smart-pointers-dependency-injection.html)

HappyS5 July 16, 2021 14:57

OpenFOAM smart pointers and Dependency Injection
 
Hello,

Dr. Tomislav Maric told me to understand OpenFOAM smart pointers thoroughly. I know that auto_ptr and tmp are the two smart pointers often used. I would like to know if a main purpose of an OpenFoam smart pointer is to control coupling by dependency injection.

olesen July 17, 2021 05:07

Quote:

Originally Posted by HappyS5 (Post 808299)
Hello,

Dr. Tomislav Maric told me to understand OpenFOAM smart pointers thoroughly. I know that auto_ptr and tmp are the two smart pointers often used. I would like to know if a main purpose of an OpenFoam smart pointer is to control coupling by dependency injection.

The main purpose is actually memory management, memory reuse and avoiding copying etc.


All times are GMT -4. The time now is 10:03.