ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved