[Xorp-hackers] xorp callback construction

mike@lrlart.com mike@lrlart.com
Thu, 23 Mar 2006 14:17:49 -0700


Hey all,

I'm running into a compile error that I am unable to circumvent. I
written a xorp module that sends commands to the fea, but in
constructing the callback to be dispatched to
XrlIfmgrV0p1Client::send_start_transaction(), I have the following
line, which should instantiate the start transaction callback:

uint32_t tid;
XrlIfmgrV0p1Client::StartTransactionCB cb2 =
XrlIfmgrV0p1Client::StartTransactionCB(this,
&XrlRLInterfacesNode::send_start_transaction_cb, &tid);

The "this" object is a child class that derives from
 class XrlRLInterfacesNode :     public XrlStdRouter, /* used for
dispatch of xrl messages */
                            public XrlRlInterfacesTargetBase { /* used
for defined interface */

However, the compilier is unhappy with the instantiation of the
StartTransactionCB object though:

xrl_rl_interfaces_node.cc:943: error: no matching function for call to
`ref_ptr<XorpCallback2<void, const XrlError&, const uint32_t*>
>::ref_ptr(XrlRLInterfacesNode* const, void
(XrlRLInterfacesNode::*)(const XrlError&, const uint32_t*), uint32_t*)'
../libxorp/ref_ptr.hh:247: note: candidates are:
ref_ptr<_Tp>::ref_ptr(_Tp*, int32_t) [with _Tp = XorpCallback2<void,
const XrlError&, const uint32_t*>]
../libxorp/ref_ptr.hh:149: note:                
ref_ptr<_Tp>::ref_ptr(const ref_ptr<_Tp>&) [with _Tp =
XorpCallback2<void, const XrlError&, const uint32_t*>]
../libxorp/ref_ptr.hh:136: note:                
ref_ptr<_Tp>::ref_ptr(_Tp*) [with _Tp = XorpCallback2<void, const
XrlError&, const uint32_t*>]

The callback method is defined as:

void send_start_transaction_cb(const XrlError &xrl_error, const uint32_t
*tid);

So, it looks as if my callback method isn't defined correctly, but in
searching through the xorp source--but it looks correct to me (but I'm
probably missing something obvious). 

Thanks for any help!


Mike Larson