Bug 1293

Summary: Change inheritance for ns3::Chunk
Product: ns-3 Reporter: Alex Afanasyev <alexander.afanasyev>
Component: networkAssignee: ns-bugs <ns-bugs>
Status: RESOLVED WONTFIX    
Severity: normal CC: mathieu.lacage
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   

Description Alex Afanasyev 2011-11-14 17:08:50 UTC
ns3::Chunk should be inherited from SimpleRef<Chunk,ObjectBase>. This will allow headers to be wrapped up in ns3::Ptr smart pointer, if necessary.

The following patch does the thing: https://bitbucket.org/cawka/ns-3-dev/changeset/11d5ee4861e8
Comment 1 Mathieu Lacage 2012-03-19 04:35:53 UTC
Unless you come up with an explanation of why you want to do this, no. The idea of allowing chunks be created on the heap is not bad per se, but doing as you suggest would not mesh very well with the current usage of chunks that are allocated on the stack. I would suggest that you use boost::shared_ptr if you need to do this.