adapded to Benedikts Linear Function s
todo:
- clear up how much of SA[...]0.3.27/src/Agent.cpp: 1014 falls into my domain
- adapt once "Reliableagents" exist
- cleanup
adapded to Benedikts Linear Function s
Description
Details
Event TimelineComment Actions I see that you are accepting raw pointers as input to addCrossReliabilityProfile and expect them to be uniquely owned by the module. I made the same mistake (actually mine was a lot worse since I did not delete them in the destructor), but agree with @juhasz that it is bad practice. Can you move to std::uniqe_ptr's/std::shared_ptr's? Comment Actions Moved it to std::unique_ptr . It is updatet in Functionality_Reliability Branch Comment Actions Any reason why you are opposed to use smart pointers? As they are used throughout the library, I would suggest to use them everywhere. Comment Actions I'm normally against using shared pointers when the resources aren't explicitly meant to be shared done Comment Actions I agree with that! :) Comment Actions I already changed it to shared pointers to hold the lib consistent. Or did I misunderstand something and abstractions are meant to be shared ? So David you decide shared or unique pointers ? [Concerning the consistency] Comment Actions About consistency: we should use smart pointers. Whether to use shared or unique pointer is to be decided for each usage separately. If one object is shared and needs to be referenced from multiple places at the same time, then shared pointer must be used; unique pointer otherwise. Abstractions in this case are uniquely owned and not shared -- as far as I remember. So std::unique_ptr should be used here. @btutzer, how do you see this? Comment Actions Sounds good to me, although I did not think about unique/shared in this case. I agree that unique_ptr would be the way to go, unless, @dschnoell can think about a case where the abstractions may be passed around and not solely owned by a ReliableAgent object. Comment Actions As discussed with @btutzer currently there isn't a case, but at some point it could be beneficial to be able to adapt the the abstractions during run time. So it will stay a shared pointer. |