aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Threading/Callback.h
diff options
context:
space:
mode:
authorAzazel <azazel.kon@gmail.com>2011-04-08 09:41:52 +0600
committerAzazel <azazel.kon@gmail.com>2011-04-08 09:41:52 +0600
commit74b84a603d4592b653f670db544b75ffb7b495fb (patch)
treed6aa2d5d7ddd83afb5747635470a747863693193 /src/server/shared/Threading/Callback.h
parent0ae5aca55e91e7af7cd6c8ad6479aec0f93f7b3c (diff)
Core/DBLayer: add template parameter to QueryCallback classes to make it work with both QueryResult and PreparedQueryResult (will be used later).
Diffstat (limited to 'src/server/shared/Threading/Callback.h')
-rwxr-xr-xsrc/server/shared/Threading/Callback.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/server/shared/Threading/Callback.h b/src/server/shared/Threading/Callback.h
index 9ea48070054..b179b215253 100755
--- a/src/server/shared/Threading/Callback.h
+++ b/src/server/shared/Threading/Callback.h
@@ -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;
};