[ndnSIM] calling dynamic variable from content-store-impl.hpp in another function

Alex Afanasyev aa at CS.UCLA.EDU
Thu Jul 7 08:36:05 PDT 2016

> On Jul 7, 2016, at 6:26 AM, Zeinab Rezaiefar <zeinab.rezaiefar at gmail.com> wrote:
> hello everyone,
> I have defined public variable in class ContentStoreImpl (double invalid_content)  in content-store-impl.hpp. furthermore I have change these value in ContentStoreImpl<Policy>::Add (invalid_content++;) I want to access this value through files in scratch folder .
> therefore I include this path (#include "ns3/ndnSIM/model/cs/content-store-impl.h").  I want to access it before main function as below:
> using namespace ns3;
> void
> CacheEntryRemoved(std::string context, Ptr<const ndn::cs::Entry> entry, Time lifetime)
> {
> if (entry->GetData()->GetSignature()!=0){
> //ContentStoreImpl a;
> Ptr<ndn::cs::ContentStoreImpl> content;
> content.invalid_content--;
> }
> }
> however, I have received error  (mismatch at argument 1 in template parameter list for ‘template<class T> class ns3::Ptr’)
> is there anybody knows how I can access this value through this function.
> I will become thankful, if I know your opinion
> thanks in advance
> best regards

I'm not exactly sure what you're trying to do in the main function...  Even if you going to make it compile, "Ptr<ndn::cs::ContentStoreImpl> content;" be a null pointer.

What is the exact error you're having?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160707/50dbfca7/attachment.bin>

More information about the ndnSIM mailing list