[ndnSIM] cannot find Find (const Name &prefix) in ns3::ndn::Fib
Alex Afanasyev
alexander.afanasyev at ucla.edu
Wed Mar 20 10:20:38 PDT 2013
Why did you manually added (1) or (2) ? You should just have pulled the update from github...
If you don't like git, you could have just applied a patch.
In any case, you're just missing a method declaration in ndn-fib-impl.h (https://github.com/NDN-Routing/ndnSIM/commit/e5a8b5a276cfbda168cd07f87807a75e9acb65c5#L3R91)
---
Alex
On Mar 20, 2013, at 3:43 AM, yao hu <huyao0107 at gmail.com> wrote:
> Hi Alex,
>
> Thanks for reply to my previous question. Now I am continuing my work.
>
> I want to look up FIB when Data packet comes (doing this in ForwardingStrategy::DidReceiveSolicitedData()), however I cannot find the call Find (const Name &prefix) in my local file model/fib/ndn-fib.h which is shown on the online API documentation. So I added (1) into ndn-fib.h and (2) into ndn-fib-impl.cc, but after compiling, it shows the error message (3).
>
> What else should I do? Or is there any other ways to look up FIB (fib::Entry should be returned) in the call ForwardingStrategy::DidReceiveSolicitedData()?
> Thanks very much!
>
> ---
> (1)
> virtual Ptr<fib::Entry>
> Find (const Name &prefix) = 0;
>
> (2)
> Ptr<fib::Entry>
> FibImpl::Find (const Name &prefix)
> {
> super::iterator item = super::find_exact (prefix);
>
> if (item == super::end ())
> return 0;
> else
> return item->payload ();
> }
>
> (3)
> ../src/ndnSIM/model/fib/ndn-fib-impl.cc:88:34: error: no ‘ns3::Ptr<ns3::ndn::fib::Entry> ns3::ndn::fib::FibImpl::Find(const ns3::ndn::Name&)’ member function declared in class ‘ns3::ndn::fib::FibImpl’
> In file included from ./ns3/object-base.h:23:0,
> from ./ns3/object.h:29,
> from ./ns3/node.h:26,
> from ./ns3/ndn-fib.h:25,
> from ../src/ndnSIM/model/fib/ndn-fib-impl.h:24,
> from ../src/ndnSIM/model/fib/ndn-fib-impl.cc:21:
> ./ns3/type-id.h: In static member function ‘static ns3::ObjectBase* ns3::TypeId::AddConstructor()::Maker::Create() [with T = ns3::ndn::fib::FibImpl]’:
> ./ns3/type-id.h:396:59: instantiated from ‘ns3::TypeId ns3::TypeId::AddConstructor() [with T = ns3::ndn::fib::FibImpl]’
> ../src/ndnSIM/model/fib/ndn-fib-impl.cc:51:31: instantiated from here
> ./ns3/type-id.h:392:34: error: cannot allocate an object of abstract type ‘ns3::ndn::fib::FibImpl’
> ../src/ndnSIM/model/fib/ndn-fib-impl.h:66:7: note: because the following virtual functions are pure within ‘ns3::ndn::fib::FibImpl’:
> ./ns3/ndn-fib.h:70:3: note: virtual ns3::Ptr<ns3::ndn::fib::Entry> ns3::ndn::Fib::Find(const ns3::ndn::Name&)
> Waf: Leaving directory `/root/ndnSIM/ns-3/build'
> Build failed
> -> task in 'ns3-ndnSIM' failed (exit status 1):
> {task 167312460: cxx ndn-fib-impl.cc -> ndn-fib-impl.cc.1.o}
>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130320/872664e2/attachment.html>
More information about the ndnSIM
mailing list