- Implement QueryCallback_2 template for ACE_Future callbacks using 2 parameters for the callback function
- Make MSG_LIST_STABLED_PETS´s handler use async query instead of blocking query

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-08-24 19:04:25 +02:00
parent e5337169c8
commit 4185bb3181
3 changed files with 69 additions and 0 deletions

View File

@@ -76,4 +76,61 @@ class QueryCallback
ParamType param;
};
template <typename ParamType1, typename ParamType2>
class QueryCallback_2
{
public:
QueryCallback_2() {}
void SetFutureResult(QueryResultFuture value)
{
result = value;
}
QueryResultFuture GetFutureResult()
{
return result;
}
int IsReady()
{
return result.ready();
}
void GetResult(QueryResult_AutoPtr& res)
{
result.get(res);
}
void FreeResult()
{
result.cancel();
}
void SetFirstParam(ParamType1 value)
{
param_1 = value;
}
void SetSecondParam(ParamType2 value)
{
param_2 = value;
}
ParamType1 GetFirstParam()
{
return param_1;
}
ParamType2 GetSecondParam()
{
return param_2;
}
private:
QueryResultFuture result;
ParamType1 param_1;
ParamType2 param_2;
};
#endif