[boost] Re: [Threads] Simple active object wrapper, take 2
by Matthew Vogt other posts by this author
Mar 3 2004 2:42AM messages near this date
Re: [boost] Re: [Threads] Simple active object wrapper, take 2
|
[boost] Re: [Threads] Simple active object wrapper, take 2
Matthew Vogt <mvogt <at> juptech.com> writes:
> Anyway, I think some reasonably clean syntax can be found to bind both the
> arguments and the return address into the function call, provided that the
> return address is a method in the invoking object.
>
Well, after some fiddling, the best I can manage is:
class SomeClass
{
public:
std::string value(int id) { return "foo"; }
}
class ThatServant : public reactive<ThatServant> , private SomeClass
{
public:
ThatServant() : getValue(&ThatServant::value, this) {}
method<std::string (int)> getValue;
};
class ThisServant : public reactive<ThisServant>
{
public:
void findAndStoreValue(ThisServant& other, int id)
{
(return_to(&ThisServant::storeValue, this)) = other.getValue(int);
}
private:
void storeValue(std::string value) { ... }
}
Matt
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Mark Blewett
Matthew Vogt
Matthew Vogt
scott
|