SUMO - Simulation of Urban MObility
FuncBinding_StringParam.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Function type template
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef FuncBinding_StringParam_h
22 #define FuncBinding_StringParam_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
43 template< class T, typename R >
45 public:
47  typedef R(T::* Operation)(const std::string&) const;
48 
49  FuncBinding_StringParam(T* source, Operation operation,
50  const std::string& param)
51  :
52  mySource(source),
53  myOperation(operation),
54  myParam(param) {}
55 
58 
59  R getValue() const {
60  return (mySource->*myOperation)(myParam);
61  }
62 
63  ValueSource<R>* copy() const {
66  }
67 
69  throw 1;
70  }
71 
72 
73 protected:
74 
75 private:
78 
81 
82  std::string myParam;
83 
84 };
85 
86 
87 #endif
88 
89 /****************************************************************************/
90 
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< SUMOReal > * makeSUMORealReturningCopy() const
FuncBinding_StringParam(T *source, Operation operation, const std::string &param)
ValueSource< R > * copy() const