[ndnSIM] query about interfaces of a node

Alex Afanasyev alexander.afanasyev at ucla.edu
Fri Sep 12 16:07:50 PDT 2014


On Sep 12, 2014, at 7:16 AM, Shahneela Naz <shahneela.cs at gmail.com> wrote:

> Dear Users,
> 
> I want to make a little change in cache-with-probability class that if a node has certain number of interfaces it should add a content. For this I want to know number of interfaces to which the node is attached.
> 
> but when I try to get a node as follows
> 
> Ptr<Node> n = This->GetObject<Node>();
> 
> it gives error that the function is defined out of scope. it is the problem due to virtual or inline function calls...
> 
> can any one kindly help me on this.. If I want to get information related to a node while using policy traits. how can I do this..

Hi Shaneela,

Where exactly you're adding this? If you're inside any of the policy methods, you can do something like:

Ptr<Node> n = item->payload ()->GetContentStore()->template GetObject<Node>();

Note that there is "template" keyword before GetObject.  Is is necessary, since policy and all policy methods are part of the template implementation.

---
Alex


> regards,
> 
> Shahneela 
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim





More information about the ndnSIM mailing list