Geant4  10.02.p03
G4AnyMethod::FuncRef< S, T > Struct Template Reference
Inheritance diagram for G4AnyMethod::FuncRef< S, T >:
Collaboration diagram for G4AnyMethod::FuncRef< S, T >:

Public Member Functions

 FuncRef (S(T::*f)())
 
virtual void operator() (void *obj)
 
virtual void operator() (void *, const std::string &)
 
virtual PlaceholderClone () const
 
virtual const std::type_info & ArgType (size_t) const
 
- Public Member Functions inherited from G4AnyMethod::Placeholder
 Placeholder ()
 
virtual ~Placeholder ()
 

Public Attributes

S(T::* fRef )()
 

Detailed Description

template<class S, class T>
struct G4AnyMethod::FuncRef< S, T >

Definition at line 156 of file G4AnyMethod.hh.

Constructor & Destructor Documentation

◆ FuncRef()

template<class S , class T >
G4AnyMethod::FuncRef< S, T >::FuncRef ( S(T::*)()  f)
inline

Definition at line 157 of file G4AnyMethod.hh.

157 : fRef(f) {}

Member Function Documentation

◆ ArgType()

template<class S , class T >
virtual const std::type_info& G4AnyMethod::FuncRef< S, T >::ArgType ( size_t  ) const
inlinevirtual

Implements G4AnyMethod::Placeholder.

Definition at line 168 of file G4AnyMethod.hh.

168  {
169  return typeid(void);
170  }

◆ Clone()

template<class S , class T >
virtual Placeholder* G4AnyMethod::FuncRef< S, T >::Clone ( ) const
inlinevirtual

Implements G4AnyMethod::Placeholder.

Definition at line 165 of file G4AnyMethod.hh.

165  {
166  return new FuncRef(fRef);
167  }

◆ operator()() [1/2]

template<class S , class T >
virtual void G4AnyMethod::FuncRef< S, T >::operator() ( void *  obj)
inlinevirtual

Implements G4AnyMethod::Placeholder.

Definition at line 159 of file G4AnyMethod.hh.

159  {
160  ((T*)obj->*fRef)();
161  }

◆ operator()() [2/2]

template<class S , class T >
virtual void G4AnyMethod::FuncRef< S, T >::operator() ( void *  ,
const std::string &   
)
inlinevirtual

Implements G4AnyMethod::Placeholder.

Definition at line 162 of file G4AnyMethod.hh.

162  {
163  throw G4BadArgument();
164  }
Here is the call graph for this function:

Member Data Documentation

◆ fRef

template<class S , class T >
S(T::* G4AnyMethod::FuncRef< S, T >::fRef) ()

Definition at line 171 of file G4AnyMethod.hh.


The documentation for this struct was generated from the following file: