[Ns-bugs] [Bug 23] New: Callbacks cannot be created for member methods and Ptr<T> object instances

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Sun May 13 00:52:32 PDT 2007


http://www.nsnam.org/bugzilla/show_bug.cgi?id=23

           Summary: Callbacks cannot be created for member methods and
                    Ptr<T> object instances
           Product: ns-3
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: simulation core
        AssignedTo: ns-bugs at isi.edu
        ReportedBy: mathieu.lacage at sophia.inria.fr


the following code will not compile:

Ptr<MyObject> p;
MakeCallback (&MyObject::MyMethod, p);

The solution probably would require us to define a CallbackTraits<T> template
class and specialize it for the Ptr class:

template <typename T>
struct CallbackTraits
{
  typedef T * PointerType;
};

template <>
struct CallbackTraits<Ptr>
{
  typedef Ptr<T> PointerType
};

and use CallbackTraits<T>::PointerType in callback.h wherever we use T *.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list