Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion On callbacks
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
C Facchini  
View profile  
 More options Sep 11 2009, 6:39 pm
From: C Facchini <c.facch...@gmail.com>
Date: Fri, 11 Sep 2009 15:39:11 -0700 (PDT)
Local: Fri, Sep 11 2009 6:39 pm
Subject: Re: On callbacks
Hi Antti,

> >   void CwndTracer (uint32_t oldval, uint32_t newval);

>   What if I connect WITH context? Context is passed as a string,
> right?

> I'm getting error as

> got=ns3::FunctorCallbackImpl<void (*)(std::string, bool, bool), void,
> std::string, bool, bool, ns3::empty, ns3::empty, ns3::empty,
> ns3::empty, ns3::empty, ns3::empty>
> expected=ns3::CallbackImpl<void, std::string, bool, ns3::empty,
> ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty,
> ns3::empty>*

> when trying to connect my TracedValue<bool> to a function with func
> (std::string, bool, bool). If the function is just (std::string, bool)
> it works (and seems to be getting only the new values). I'm setting
> the TracedValue with () though, not with =.

The error you posted tells that you defined a function that accepts
three arguments (one string and two booleans) but he expects to find a
function taking just two arguments (one string and one boolean).
As a matter of fact, you admit that it works in the case you define a
callback that accepts the two parameters string and bool.

Out of my curiosity, what's the variable you're trying to trace?
As far as I understand, if the variable is based on the template
defined in src/core/traced-value.h you should be able to trace it
thanks to the callback, which is of the form:
  TracedCallback<T,T> m_cb;
and hence it only accepts two parameters of the same type (then,
ConnectWithContext adds a string, but that's another story); still,
you seem to be using something different.

Regards,
Christian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.