45 #define G4AnyMethod_h 1
54 virtual const char*
what()
const throw() {
55 return "G4BadArgument: failed operator()";
77 template <
class S,
class T,
class A0,
class A1>
G4AnyMethod(S (T::*f)(A0,A1)) :
narg(2) {
128 const std::type_info&
ArgType(
size_t n = 0)
const {
139 virtual void operator()(
void*,
const std::string&) = 0;
140 virtual const std::type_info&
ArgType(
size_t)
const = 0;
155 virtual const std::type_info&
ArgType(
size_t)
const {
171 std::stringstream strs(s0);
178 virtual const std::type_info&
ArgType(
size_t)
const {
196 std::stringstream strs(s0);
203 virtual const std::type_info&
ArgType(
size_t i)
const {
204 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 *)