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 
FuncBinding_StringParam::FuncBinding_StringParam
FuncBinding_StringParam(T *source, Operation operation, const std::string &param)
Definition: FuncBinding_StringParam.h:42
FuncBinding_StringParam::myOperation
Operation myOperation
The object's operation to perform.
Definition: FuncBinding_StringParam.h:73
FuncBinding_StringParam::getValue
R getValue() const
Definition: FuncBinding_StringParam.h:52
FuncBinding_StringParam::mySource
T * mySource
The object the action is directed to.
Definition: FuncBinding_StringParam.h:70
FuncBinding_StringParam::makedoubleReturningCopy
ValueSource< double > * makedoubleReturningCopy() const
Definition: FuncBinding_StringParam.h:61
FuncBinding_StringParam::copy
ValueSource< R > * copy() const
Definition: FuncBinding_StringParam.h:56
FuncBinding_StringParam::~FuncBinding_StringParam
~FuncBinding_StringParam()
Destructor.
Definition: FuncBinding_StringParam.h:50
ValueSource.h
FuncBinding_StringParam::myParam
std::string myParam
Definition: FuncBinding_StringParam.h:75
FuncBinding_StringParam::Operation
R(T::* Operation)(const std::string &) const
Type of the function to execute.
Definition: FuncBinding_StringParam.h:40
config.h
ValueSource
Definition: ValueSource.h:33
FuncBinding_StringParam
Definition: FuncBinding_StringParam.h:37