Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Function type template
17 /****************************************************************************/
18 #ifndef FuncBinding_StringParam_h
19 #define FuncBinding_StringParam_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
36 template< class T, typename R >
38 public:
40  typedef R(T::* Operation)(const std::string&) const;
41 
42  FuncBinding_StringParam(T* source, Operation operation,
43  const std::string& param)
44  :
45  mySource(source),
46  myOperation(operation),
47  myParam(param) {}
48 
51 
52  R getValue() const {
53  return (mySource->*myOperation)(myParam);
54  }
55 
56  ValueSource<R>* copy() const {
59  }
60 
62  throw 1;
63  }
64 
65 
66 protected:
67 
68 private:
71 
74 
75  std::string myParam;
76 
77 };
78 
79 
80 #endif
81 
82 /****************************************************************************/
83 
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