On Sat, Dec 15, 2007 at 05:57:20PM -0500, Paul Thomas wrote:
> I'm completely lost as to how I could "store an array of functors for
> objects using libssh2". Is this some undocumented part of the library?
> Would I somehow tell the library about my object's address?
As someone else has already pointed out here, you don't actually need
this step. You can pass in to libssh2 a pointer (in your case, it would
be to your libssh2 wrapper object) directly which you can access from
the callback function to gain access to your object.
If that option weren't available, you could use the technique I mentioned.
Essentially, you create your own static mapping between libssh2 session
pointers and libssh2-using C++ objects before starting the transfer.
Your callback is passed the libssh2 session pointer which you would use
to look up the appropriate C++ object. A functor is a convenient way to
pass from the C to C++ worlds.
>>> Dan
-- http://www.MoveAnnouncer.com The web change of address service Let webmasters know that your web site has moved ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ libssh2-devel mailing list libssh2-devel_at_lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libssh2-develReceived on 2007-12-16