[ndnSIM] Get the nodes object in forward.cpp

DJEMAA Adel a_djemaa at esi.dz
Wed Jan 29 08:42:21 PST 2020


Hi,
To get node ID in forwarder class, you should use this commands:

auto node = ns3::NodeList::GetNode(ns3::Simulator::GetContext());

std::cout<<" Node ID : "<<node->GetId()<<std::endl;  //Just for verification


Hope will help.

Regards.


Le mer. 29 janv. 2020 à 08:37, 15068375219 <15068375219 at 139.com> a écrit :

> Dear all,
> I'm trying to get the nodes object in forward.cpp.
> In previous discussion email which subject is "access stored content in
> cache from forward.cpp".
> Mr./Ms Zeinab used the following code to get the name of the cached
> content.
>
>   for(ns3::Ptr<ns3::ndn::cs::Entry> csentry= m_csFromNdnSim->Begin();
>       csentry!= m_csFromNdnSim->End();
> csentry=m_csFromNdnSim->Next(csentry))
>   {
>       std::cout<<"the name"<<csentry->GetName()<<"is stored in  node with
>       id"<<node->GetId()<<"\n";
>   }
>
> I also want to implement such code, but I don't know how to get the object
> of node.
> Maybe this is a simple problem, but I haven't solved it for a long time.
> Your help is really appreciated !
>
> Regards,
> Yin
>
>
>
>
>
>
> 殷继亮
>
> 15068375219 at 139.com
> 电子名片新出VIP模板啦,快来体验>>
> [image: 扫描二维码添加名片到手机]
>
> 扫一扫,
>
> 快速添加名片到手机
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>


-- 
Bien cordialement.
Mr DJAMA Adel.
Ecole Nationale Superieure d'Informatique - Oued smar, Alger, Algérie.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20200129/59912033/attachment.html>


More information about the ndnSIM mailing list