libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
qi::AnyFunction Class Reference

#include <anyfunction.hpp>

Public Member Functions

 AnyFunction ()
 
 ~AnyFunction ()
 
 AnyFunction (const AnyFunction &b)
 
 AnyFunction (FunctionTypeInterface *type, void *value)
 
AnyFunctionoperator= (const AnyFunction &b)
 
AnyReference call (const AnyReferenceVector &args)
 
AnyReference call (AnyReference arg1, const AnyReferenceVector &args)
 Call the function, reference must be destroy()ed. More...
 
AnyReference operator() (const AnyReferenceVector &args)
 Call the function, reference must be destroy()ed. More...
 
template<typename R >
call (qi::AutoAnyReference p1=qi::AutoAnyReference(), qi::AutoAnyReference p2=qi::AutoAnyReference(), qi::AutoAnyReference p3=qi::AutoAnyReference(), qi::AutoAnyReference p4=qi::AutoAnyReference(), qi::AutoAnyReference p5=qi::AutoAnyReference(), qi::AutoAnyReference p6=qi::AutoAnyReference(), qi::AutoAnyReference p7=qi::AutoAnyReference(), qi::AutoAnyReference p8=qi::AutoAnyReference())
 Call the function. More...
 
template<typename R >
AnyReference operator() (qi::AutoAnyReference p1=qi::AutoAnyReference(), qi::AutoAnyReference p2=qi::AutoAnyReference(), qi::AutoAnyReference p3=qi::AutoAnyReference(), qi::AutoAnyReference p4=qi::AutoAnyReference(), qi::AutoAnyReference p5=qi::AutoAnyReference(), qi::AutoAnyReference p6=qi::AutoAnyReference(), qi::AutoAnyReference p7=qi::AutoAnyReference(), qi::AutoAnyReference p8=qi::AutoAnyReference())
 Call the function, reference must be destroy()ed. More...
 
const AnyFunctiondropFirstArgument () const
 Change signature, drop the first argument passed to call. More...
 
const AnyFunctionreplaceFirstArgument (void *value) const
 Replace first argument by value which must be storage for correct type. More...
 
const AnyFunctionprependArgument (void *value) const
 Prepend extra argument value to argument list. More...
 
std::vector< TypeInterface * > argumentsType () const
 Return expected argument types, taking transform into account. More...
 
TypeInterfaceresultType () const
 
Signature parametersSignature (bool dropFirst=false) const
 
Signature returnSignature () const
 
void swap (AnyFunction &b)
 
 operator bool () const
 
FunctionTypeInterfacefunctionType () const
 
template<typename T >
AnyFunction from (T &&f)
 

Static Public Member Functions

template<typename F >
static AnyFunction from (F &&func)
 
template<typename F , typename C >
static AnyFunction from (F func, C instance)
 
static AnyFunction fromDynamicFunction (DynamicFunction f)
 

Detailed Description

Represents a generic callable function. This class has value semantic.

Definition at line 149 of file anyfunction.hpp.

Constructor & Destructor Documentation

qi::AnyFunction::AnyFunction ( )
inline

Definition at line 35 of file anyfunction.hxx.

qi::AnyFunction::~AnyFunction ( )
inline

Definition at line 64 of file anyfunction.hxx.

qi::AnyFunction::AnyFunction ( const AnyFunction b)
inline

Definition at line 39 of file anyfunction.hxx.

qi::AnyFunction::AnyFunction ( FunctionTypeInterface type,
void *  value 
)
inline

Definition at line 46 of file anyfunction.hxx.

Member Function Documentation

std::vector<TypeInterface*> qi::AnyFunction::argumentsType ( ) const

Return expected argument types, taking transform into account.

AnyReference qi::AnyFunction::call ( const AnyReferenceVector args)

Calls the function.

Parameters
argsA list of unnamed arguments, each wrapped in an AnyReference for allowing introspection.
Exceptions
Ifan argument mismatches the signature, or is invalid.
AnyReference qi::AnyFunction::call ( AnyReference  arg1,
const AnyReferenceVector args 
)

Call the function, reference must be destroy()ed.

Call the function.

const AnyFunction& qi::AnyFunction::dropFirstArgument ( ) const

Change signature, drop the first argument passed to call.

template<typename F >
static AnyFunction qi::AnyFunction::from ( F &&  func)
static
template<typename F , typename C >
AnyFunction qi::AnyFunction::from ( func,
instance 
)
static
Returns
a AnyFunction binding instance to member function func

Definition at line 696 of file anyfunctionfactory.hxx.

template<typename T >
AnyFunction qi::AnyFunction::from ( T &&  f)

Definition at line 671 of file anyfunctionfactory.hxx.

static AnyFunction qi::AnyFunction::fromDynamicFunction ( DynamicFunction  f)
static
Returns
a AnyFunction that takes arguments as a list of unconverted AnyReference.
FunctionTypeInterface * qi::AnyFunction::functionType ( ) const
inline

Definition at line 82 of file anyfunction.hxx.

qi::AnyFunction::operator bool ( ) const
inline

Definition at line 77 of file anyfunction.hxx.

AnyReference qi::AnyFunction::operator() ( const AnyReferenceVector args)
inline

Call the function, reference must be destroy()ed.

Definition at line 30 of file anyfunction.hxx.

Call the function, reference must be destroy()ed.

AnyFunction & qi::AnyFunction::operator= ( const AnyFunction b)
inline

Definition at line 52 of file anyfunction.hxx.

Signature qi::AnyFunction::parametersSignature ( bool  dropFirst = false) const
const AnyFunction& qi::AnyFunction::prependArgument ( void *  value) const

Prepend extra argument value to argument list.

const AnyFunction& qi::AnyFunction::replaceFirstArgument ( void *  value) const

Replace first argument by value which must be storage for correct type.

TypeInterface* qi::AnyFunction::resultType ( ) const
Signature qi::AnyFunction::returnSignature ( ) const
void qi::AnyFunction::swap ( AnyFunction b)
inline

Definition at line 70 of file anyfunction.hxx.


The documentation for this class was generated from the following files: