[ndnSIM] TypeId name look up is failing.

Anil Jangam anilj.mailing at gmail.com
Mon Nov 24 10:32:08 PST 2014


Alex,

I found the bug in my code! The GetTypeId() method was not setting the
correct parent and group name for the application class I wrote. After
modifying the method (as below), it worked!

The example script now able to recognize the new application class being
installed on the node and is able to invoke StartApplication() method. I
could verify this from some of the Node specific configuration I am
printing from the StartApplication.

The updated GetTypeId() method looks like below.

TypeId
NlsrApp::GetTypeId (void)
{
  static TypeId tid = TypeId ("ns3::ndn::NlsrApp")
.SetGroupName ("Ndn")
.SetParent<App> ()
.AddConstructor<NlsrApp> ()
    ;
  return tid;
}


/anil.


On Mon, Nov 24, 2014 at 1:15 PM, Anil Jangam <anilj.mailing at gmail.com>
wrote:

> Hi Alex,
>
> I am testing a new application class and trying to create a application
> helper instance for the same.
>
> When I run the example test case, it is throwing an exception from the
> below function where the name look up is  failing.
>
> TypeId
> TypeId::LookupByName (std::string name)
> {
>   NS_LOG_FUNCTION (name);
>   uint16_t uid = Singleton<IidManager>::Get ()->GetUid (name);
>   NS_ASSERT_MSG (uid != 0, "Assert in TypeId::LookupByName: " << name << "
> not found");
>   return TypeId (uid);
> }
>
>
> I am not sure what is missing here which is causing this exception.
>
> /anil.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20141124/4a3589c5/attachment.html>


More information about the ndnSIM mailing list