Dear all
Hi!
I am a newbie in ns3 and C++, I suspect my question is more concerned as a C++ problem, but I just a bit puzzled on the 'smart pointer' or 'Ptr<>'.
Comparing with 802.11p, we initialize a network through :
Wifi80211pHelper wifi80211p = Wifi80211pHelper::Default ();
basically this is the structure of :
Class Type classname = class::method.
but in lte the case becomes different:
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
which basically become:
int *lteHelper;
lteHelper=&LteHelper;
lteHelper.CreateObject<LteHelper> ();
i think there must be a reason for doing so, or else may we go for
LteHelper lteHelper = LteHelper::CreateObject<LteHelper>; ?
I know this can be a quite silly problem, but yet any suggestions or comments is welcomed!
attached with the document page of Ptr<T>:
https://www.nsnam.org/docs/doxygen/classns3_1_1_ptr.html#a07865cd0a6aceaa840a30d4961e1bca7Yifei Jin