Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4AnyMethod Class Reference

#include <G4AnyMethod.hh>

Public Member Functions

 G4AnyMethod ()
 
template<class S , class T >
 G4AnyMethod (S(T::*f)())
 
template<class S , class T , class A0 >
 G4AnyMethod (S(T::*f)(A0))
 
template<class S , class T , class A0 , class A1 >
 G4AnyMethod (S(T::*f)(A0, A1))
 
 G4AnyMethod (const G4AnyMethod &other)
 
 ~G4AnyMethod ()
 
G4AnyMethodSwap (G4AnyMethod &rhs)
 
template<class S , class T >
G4AnyMethodoperator= (S(T::*f)())
 
template<class S , class T , class A0 >
G4AnyMethodoperator= (S(T::*f)(A0))
 
template<class S , class T , class A0 , class A1 >
G4AnyMethodoperator= (S(T::*f)(A0, A1))
 
G4AnyMethodoperator= (const G4AnyMethod &rhs)
 
bool Empty () const
 
void operator() (void *obj)
 
void operator() (void *obj, const std::string &a0)
 
size_t NArg () const
 
const std::type_info & ArgType (size_t n=0) const
 

Detailed Description

This class represents any object method. The class only holds a member pointer.

Definition at line 82 of file G4AnyMethod.hh.

Constructor & Destructor Documentation

G4AnyMethod::G4AnyMethod ( )
inline

contructor

Definition at line 85 of file G4AnyMethod.hh.

85 : fContent(0), narg(0) {}

Here is the caller graph for this function:

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

Definition at line 86 of file G4AnyMethod.hh.

86  : narg(0) {
87  fContent = new FuncRef<S,T>(f);
88  }
template<class S , class T , class A0 >
G4AnyMethod::G4AnyMethod ( S(T::*)(A0)  f)
inline

Definition at line 89 of file G4AnyMethod.hh.

89  : narg(1) {
90  fContent = new FuncRef1<S,T,A0>(f);
91  }
template<class S , class T , class A0 , class A1 >
G4AnyMethod::G4AnyMethod ( S(T::*)(A0, A1)  f)
inline

Definition at line 92 of file G4AnyMethod.hh.

92  : narg(2) {
93  fContent = new FuncRef2<S,T,A0,A1>(f);
94  }
G4AnyMethod::G4AnyMethod ( const G4AnyMethod other)
inline

Definition at line 95 of file G4AnyMethod.hh.

95  :
96  fContent(other.fContent ? other.fContent->Clone() : 0),narg(other.narg) {}
G4AnyMethod::~G4AnyMethod ( )
inline

destructor

Definition at line 98 of file G4AnyMethod.hh.

98  {
99  delete fContent;
100  }

Member Function Documentation

const std::type_info& G4AnyMethod::ArgType ( size_t  n = 0) const
inline

Definition at line 143 of file G4AnyMethod.hh.

143  {
144  return fContent ? fContent->ArgType(n) : typeid(void);
145  }
const G4int n
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData

Here is the call graph for this function:

bool G4AnyMethod::Empty ( ) const
inline

Query

Definition at line 130 of file G4AnyMethod.hh.

130  {
131  return !fContent;
132  }
size_t G4AnyMethod::NArg ( ) const
inline

Number of arguments

Definition at line 141 of file G4AnyMethod.hh.

141 { return narg; }

Here is the caller graph for this function:

void G4AnyMethod::operator() ( void obj)
inline

call operator

Definition at line 134 of file G4AnyMethod.hh.

134  {
135  fContent->operator()(obj);
136  }
void G4AnyMethod::operator() ( void obj,
const std::string &  a0 
)
inline

Definition at line 137 of file G4AnyMethod.hh.

137  {
138  fContent->operator()(obj, a0);
139  }
const G4double a0
template<class S , class T >
G4AnyMethod& G4AnyMethod::operator= ( S(T::*)()  f)
inline

Asignment operator

Definition at line 108 of file G4AnyMethod.hh.

108  {
109  G4AnyMethod(f).Swap(*this);
110  narg = 0;
111  return *this;
112  }

Here is the call graph for this function:

template<class S , class T , class A0 >
G4AnyMethod& G4AnyMethod::operator= ( S(T::*)(A0)  f)
inline

Definition at line 113 of file G4AnyMethod.hh.

113  {
114  G4AnyMethod(f).Swap(*this);
115  narg = 1;
116  return *this;
117  }

Here is the call graph for this function:

template<class S , class T , class A0 , class A1 >
G4AnyMethod& G4AnyMethod::operator= ( S(T::*)(A0, A1)  f)
inline

Definition at line 118 of file G4AnyMethod.hh.

118  {
119  G4AnyMethod(f).Swap(*this);
120  narg = 1;
121  return *this;
122  }

Here is the call graph for this function:

G4AnyMethod& G4AnyMethod::operator= ( const G4AnyMethod rhs)
inline

Asigment operator

Definition at line 124 of file G4AnyMethod.hh.

124  {
125  G4AnyMethod(rhs).Swap(*this);
126  narg = rhs.narg;
127  return *this;
128  }

Here is the call graph for this function:

G4AnyMethod& G4AnyMethod::Swap ( G4AnyMethod rhs)
inline

Definition at line 102 of file G4AnyMethod.hh.

102  {
103  std::swap(fContent, rhs.fContent);
104  std::swap(narg, rhs.narg);
105  return *this;
106  }

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