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 /****************************************************************************/
15 // Function type template
16 /****************************************************************************/
17 #ifndef FuncBinding_StringParam_h
18 #define FuncBinding_StringParam_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
35 template< class T, typename R >
37 public:
39  typedef R(T::* Operation)(const std::string&) const;
40 
41  FuncBinding_StringParam(T* source, Operation operation,
42  const std::string& param)
43  :
44  mySource(source),
45  myOperation(operation),
46  myParam(param) {}
47 
50 
51  R getValue() const {
52  return (mySource->*myOperation)(myParam);
53  }
54 
55  ValueSource<R>* copy() const {
58  }
59 
61  throw 1;
62  }
63 
64 
65 protected:
66 
67 private:
70 
73 
74  std::string myParam;
75 
76 };
77 
78 
79 #endif
80 
81 /****************************************************************************/
82 
FuncBinding_StringParam::FuncBinding_StringParam
FuncBinding_StringParam(T *source, Operation operation, const std::string &param)
Definition: FuncBinding_StringParam.h:41
FuncBinding_StringParam::myOperation
Operation myOperation
The object's operation to perform.
Definition: FuncBinding_StringParam.h:72
FuncBinding_StringParam::getValue
R getValue() const
Definition: FuncBinding_StringParam.h:51
FuncBinding_StringParam::mySource
T * mySource
The object the action is directed to.
Definition: FuncBinding_StringParam.h:69
FuncBinding_StringParam::makedoubleReturningCopy
ValueSource< double > * makedoubleReturningCopy() const
Definition: FuncBinding_StringParam.h:60
FuncBinding_StringParam::copy
ValueSource< R > * copy() const
Definition: FuncBinding_StringParam.h:55
FuncBinding_StringParam::Operation
R(T::* Operation)(const std::string &) const
Type of the function to execute.
Definition: FuncBinding_StringParam.h:39
FuncBinding_StringParam::~FuncBinding_StringParam
~FuncBinding_StringParam()
Destructor.
Definition: FuncBinding_StringParam.h:49
ValueSource.h
FuncBinding_StringParam::myParam
std::string myParam
Definition: FuncBinding_StringParam.h:74
config.h
ValueSource
Definition: ValueSource.h:32
FuncBinding_StringParam
Definition: FuncBinding_StringParam.h:36