45 #define G4AnyMethod_h 1
54 virtual const char*
what()
const throw() {
55 return "G4BadArgument: failed operator()";
59 #if defined(G4USE_STD11) || defined(G4USE_STD14)
60 #include <type_traits>
61 using std::remove_reference;
90 template <
class S,
class T,
class A0,
class A1>
G4AnyMethod(
S (T::*f)(A0,A1)) :
narg(2) {
141 const std::type_info&
ArgType(
size_t n = 0)
const {
152 virtual void operator()(
void*,
const std::string&) = 0;
153 virtual const std::type_info&
ArgType(
size_t)
const = 0;
168 virtual const std::type_info&
ArgType(
size_t)
const {
184 std::stringstream strs(s0);
191 virtual const std::type_info&
ArgType(
size_t)
const {
209 std::stringstream strs(s0);
216 virtual const std::type_info&
ArgType(
size_t i)
const {
217 return i == 0 ?
typeid(A0) :
typeid(A1);
virtual Placeholder * Clone() const
virtual void operator()(void *, const std::string &)
G4AnyMethod(S(T::*f)(A0))
G4AnyMethod(const G4AnyMethod &other)
G4AnyMethod(S(T::*f)(A0, A1))
This class represents any object method.
virtual void operator()(void *)=0
G4AnyMethod & operator=(S(T::*f)())
Asignment operator.
virtual Placeholder * Clone() const
virtual const std::type_info & ArgType(size_t) const =0
bool Empty() const
Query.
virtual void operator()(void *)
remove_reference< A0 >::type nakedA0
G4AnyMethod & Swap(G4AnyMethod &rhs)
FuncRef2(S(T::*f)(A0, A1))
size_t NArg() const
Number of arguments.
virtual void operator()(void *obj, const std::string &s0)
virtual Placeholder * Clone() const
remove_reference< A1 >::type nakedA1
virtual void operator()(void *obj, const std::string &s0)
void operator()(void *obj)
call operator
virtual const std::type_info & ArgType(size_t i) const
virtual const std::type_info & ArgType(size_t) const
const std::type_info & ArgType(size_t n=0) const
virtual const char * what() const
virtual Placeholder * Clone() const =0
remove_reference< A0 >::type nakedA0
void operator()(void *obj, const std::string &a0)
virtual void operator()(void *obj)
virtual const std::type_info & ArgType(size_t) const
virtual void operator()(void *)