CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

OpenFOAM smart pointers and Dependency Injection

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 16, 2021, 14:57
Default OpenFOAM smart pointers and Dependency Injection
  #1
Member
 
Chris Harding
Join Date: Dec 2016
Posts: 76
Rep Power: 9
HappyS5 is on a distinguished road
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.
HappyS5 is offline   Reply With Quote

Old   July 17, 2021, 05:07
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,684
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by HappyS5 View Post
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.
olesen is offline   Reply With Quote

Reply

Tags
dependency injection, smart pointer


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 21:52.