<div dir="ltr"><div><div><div>Hi,<br></div>Thanks for your reply. Yes, I have solved the compilation errors. It was due to the NULL pointer that was not handled properly.<br><br></div>Thanks & Regards,<br></div>Ayush<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 2:26 PM, Alex Afanasyev <span dir="ltr"><<a href="mailto:aa@cs.ucla.edu" target="_blank">aa@cs.ucla.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Feb 18, 2016, at 8:42 AM, Ayush Agarwal <<a href="mailto:ayush0071@gmail.com">ayush0071@gmail.com</a>> wrote:<br>
><br>
> Hello everyone,<br>
><br>
> I am using the following code to get hold of the queue object inside the forwarding strategy, OnData(....) function.<br>
><br>
> Ptr<NetDeviceFace> netDeviceFace = DynamicCast<NetDeviceFace> (inFace);<br>
> if (netDeviceFace == NULL) {  }<br>
> Ptr<NetDevice> nd = netDeviceFace->GetNetDevice ();<br>
> if (nd == NULL) {  }<br>
> PointerValue txQueueAttribute;<br>
> nd->GetAttribute ("TxQueue", txQueueAttribute);<br>
> Ptr<ns3::Queue> txQueue = txQueueAttribute.Get<ns3::Queue> ();<br>
> if (txQueue == 0) {    }<br>
><br>
> But I am getting a segmentation fault SIGSEV error while fetching the NetDevice object and the following errors for accessing queue.<br>
><br>
> ../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:238:3: error: ‘PointerValue’ was not declared in this scope<br>
>     PointerValue txQueueAttribute;<br>
>    ^<br>
> ../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:239:32: error: ‘txQueueAttribute’ was not declared in this scope<br>
>    nd->GetAttribute ("TxQueue", txQueueAttribute);<br>
>                                 ^<br>
> ../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:243:50: error: expected primary-expression before ‘>’ token<br>
>    Ptr<Queue> txQueue = txQueueAttribute.Get<Queue> ();<br>
>                                                   ^<br>
> ../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:243:53: error: expected primary-expression before ‘)’ token<br>
>    Ptr<Queue> txQueue = txQueueAttribute.Get<Queue> ();<br>
><br>
><br>
> Can you please point me out where I am going wrong.<br>
<br>
</span>Hi Ayush,<br>
<br>
Sorry for the delayed response.  I'm guessing that you have already solved the compilation problem?  Just in case, it is just a matter of adding proper includes (I think <ns3/pointer.h>, <ns3/queue.h>)<br>
<br>
---<br>
Alex<br>
<br>
</blockquote></div><br></div>