Boost logo

Boost Users :

Subject: Re: [Boost-users] Asio and bind. Queuing a bind call.
From: Nick.Adamson_at_[hidden]
Date: 2010-11-08 05:46:43


Hi Nat.

Thanks. That works nicely!

Thanks.
Nick.
 

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Nat Linden
Sent: 05 November 2010 16:15
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Asio and bind. Queuing a bind call.

On Fri, Nov 5, 2010 at 7:08 AM, <Nick.Adamson_at_[hidden]>
wrote:

        As the result of boost::bind is a template I don't know of an
stl or boost container which will store these objects.
        As there are a number of functions that can be called on my
resource with differing arguments I don't think I can use a
boost::function as I don't know the arguments to my generic post call.

I think boost::function<void()> may be exactly what you want. The usage
would be to boost::bind() your function with all the desired argument
values: I'm assuming you already know these before you decide whether
the resource is ready to service the function call. Then you can simply
call the resulting object with no additional arguments. Everything it
needs is already bound.

Then it's easy to decide whether to call it immediately, or put it in a
std::queue< boost::function<void()> >.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net