7 #ifndef _QI_ANYFUNCTION_HPP_
8 #define _QI_ANYFUNCTION_HPP_
11 #include <boost/function.hpp>
16 class AutoAnyReference;
18 template <
typename T = AnyValue>
57 # pragma warning( push )
58 # pragma warning( disable: 4251 )
79 const std::vector<TypeInterface*>& argumentsType();
94 virtual void* call(
void* storage,
void** args,
unsigned int argc) = 0;
118 template <
typename T = AnyValue>
165 template <
typename R>
189 #define pushi(z, n, _) params.push_back(p ## n);
190 #define genCall(n, ATYPEDECL, ATYPES, ADECL, AUSE, comma) \
191 template <typename R> R call( \
192 QI_GEN_ARGSDECLSAMETYPE(n, qi::AutoAnyReference)) \
194 AnyValue ret(this->operator()(AUSE), false, true); \
195 return ret.to<R>(); \
197 AnyReference operator()( \
198 QI_GEN_ARGSDECLSAMETYPE(n, qi::AutoAnyReference)) \
200 std::vector<qi::AnyReference> params; \
202 BOOST_PP_REPEAT(n, pushi, _) \
203 return call(params); \
213 const AnyFunction& replaceFirstArgument(
void* value)
const;
215 const AnyFunction& prependArgument(
void* value)
const;
218 std::vector<TypeInterface*> argumentsType()
const;
221 Signature parametersSignature(
bool dropFirst=
false)
const;
226 operator bool()
const;
240 template<
typename F,
typename C>
272 void destroy(
bool notFirst =
false);
283 # pragma warning( pop )
286 #endif // _QITYPE_ANYFUNCTION_HPP_
boost::function< AnyReference(const AnyReferenceVector &)> DynamicFunction
void destroy()
Stop and flush the logging system.
std::map< std::string, T > values
std::vector< AnyValue > VectorType
dll import/export and compiler message
std::vector< T > VectorType
VarArguments & operator()(const T &t)
#define genCall(n, ATYPEDECL, ATYPES, ADECL, AUSE, comma)
FunctionTypeInterface * dynamicFunctionTypeInterface()
A function with AnyArguments as its sole argument will behave as if AnyFunction::fromDynamicFunction ...
std::vector< AnyReference > AnyReferenceVector
void swap(::qi::AnyFunction &a,::qi::AnyFunction &b)
const VectorType & args() const
AnyArguments(const AnyValueVector &args)
TypeInterface * _resultType
Signature information for both callable types FunctionTypeInterface and MethodType.
const AnyValueVector & args() const
const VectorType & args() const
FunctionTypeInterface * makeFunctionTypeInterface()
std::vector< TypeInterface * > _argumentsType
std::vector< AnyValue > AnyValueVector
KeywordArguments & operator()(const std::string &name, const T &t)