SUMO - Simulation of Urban MObility
FuncBinding_StringParam.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // Function type template
19 /****************************************************************************/
20 #ifndef FuncBinding_StringParam_h
21 #define FuncBinding_StringParam_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
42 template< class T, typename R >
44 public:
46  typedef R(T::* Operation)(const std::string&) const;
47 
48  FuncBinding_StringParam(T* source, Operation operation,
49  const std::string& param)
50  :
51  mySource(source),
52  myOperation(operation),
53  myParam(param) {}
54 
57 
58  R getValue() const {
59  return (mySource->*myOperation)(myParam);
60  }
61 
62  ValueSource<R>* copy() const {
65  }
66 
68  throw 1;
69  }
70 
71 
72 protected:
73 
74 private:
77 
80 
81  std::string myParam;
82 
83 };
84 
85 
86 #endif
87 
88 /****************************************************************************/
89 
Operation myOperation
The object&#39;s operation to perform.
R(T::* Operation)(const std::string &) const
Type of the function to execute.
T * mySource
The object the action is directed to.
ValueSource< double > * makedoubleReturningCopy() const
FuncBinding_StringParam(T *source, Operation operation, const std::string &param)
ValueSource< R > * copy() const