From: <crai...@ee.washington.edu>
Date: Sat, 12 Sep 2009 21:27:36 -0700
Local: Sun, Sep 13 2009 12:27 am
Subject: RE: On callbacks
> Ok, currently I'm using tracecallbacks of type "Bool" and "Time". I This kind of thing is actually pretty easy to check out (okay, okay, if you > guess bool could work as TracedValue as well, but how about Time? > V4ping application uses TracedCallback<Time> m_traceRtt; know what to type). Copy the following into, say, scratch/test.cc and build it. I think you'll find it works fine. TracedValue<Time> will work if you stay away from the operators that aren't defined for a Time (e.g., ++, --). ---------- Begin Included File ---------- #include <iostream> using namespace ns3; class MyObject : public Object MyObject () {} }; void TimeTrace (Time oldValue, Time newValue) { std::cout << "Traced " << oldValue << " to " << newValue << std::endl; } int main (int argc, char *argv[]) { Ptr<MyObject> myObject = CreateObject<MyObject> (); myObject->TraceConnectWithoutContext ("MyTime", MakeCallback } ---------- End Included File ---------- 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.
| ||||||||||||||