version 4.2.0
move toStdFunction() to pibase.h refactor PIParseHelper, now it much more abstract and useful fix PIIODevice::createFromFullPath() when whitespaces at start or end are presence PIStreamPacker add events for start and end packet receive PIClientServer::ClientBase add virtual methods for start and end packet receive. also one can enable diagnostics with enableDiagnostics() method PICout now call flush() on each end of output add PIString::entries(const PIString & str)
This commit is contained in:
@@ -31,21 +31,6 @@
|
||||
|
||||
namespace PIStateMachineHelpers {
|
||||
|
||||
template<typename T>
|
||||
struct FunctionType {
|
||||
using Type = void;
|
||||
};
|
||||
|
||||
template<typename Ret, typename Class, typename... Args>
|
||||
struct FunctionType<Ret (Class::*)(Args...) const> {
|
||||
using Type = std::function<Ret(Args...)>;
|
||||
};
|
||||
|
||||
template<typename L>
|
||||
typename FunctionType<decltype(&L::operator())>::Type toStdFunction(L const & func) {
|
||||
return func;
|
||||
}
|
||||
|
||||
class FunctionBase {
|
||||
public:
|
||||
virtual ~FunctionBase() {}
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
template<typename L>
|
||||
PITransitionBase * addGuard(L f) {
|
||||
return addGuard(PIStateMachineHelpers::toStdFunction(f));
|
||||
return addGuard(toStdFunction(f));
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
|
||||
Reference in New Issue
Block a user