Core/DBLayer: add template parameter to QueryCallback classes to make it work with both QueryResult and PreparedQueryResult (will be used later).

This commit is contained in:
Azazel
2011-04-08 09:41:52 +06:00
parent 0ae5aca55e
commit 74b84a603d
3 changed files with 16 additions and 16 deletions

View File

@@ -29,18 +29,18 @@ typedef ACE_Future<PreparedQueryResult> PreparedQueryResultFuture;
issued the request. <ParamType> is variable type of parameter that is used as parameter
for the callback function.
*/
template <typename ParamType>
template <typename Result, typename ParamType>
class QueryCallback
{
public:
QueryCallback() {}
void SetFutureResult(QueryResultFuture value)
void SetFutureResult(ACE_Future<Result> value)
{
result = value;
}
QueryResultFuture GetFutureResult()
ACE_Future<Result> GetFutureResult()
{
return result;
}
@@ -50,7 +50,7 @@ class QueryCallback
return result.ready();
}
void GetResult(QueryResult& res)
void GetResult(Result& res)
{
result.get(res);
}
@@ -71,22 +71,22 @@ class QueryCallback
}
private:
QueryResultFuture result;
ACE_Future<Result> result;
ParamType param;
};
template <typename ParamType1, typename ParamType2>
template <typename Result, typename ParamType1, typename ParamType2>
class QueryCallback_2
{
public:
QueryCallback_2() {}
void SetFutureResult(QueryResultFuture value)
void SetFutureResult(ACE_Future<Result> value)
{
result = value;
}
QueryResultFuture GetFutureResult()
ACE_Future<Result> GetFutureResult()
{
return result;
}
@@ -96,7 +96,7 @@ class QueryCallback_2
return result.ready();
}
void GetResult(QueryResult& res)
void GetResult(Result& res)
{
result.get(res);
}
@@ -127,7 +127,7 @@ class QueryCallback_2
}
private:
QueryResultFuture result;
ACE_Future<Result> result;
ParamType1 param_1;
ParamType2 param_2;
};