SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CastingFunctionBinding.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // »missingDescription«
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef CastingFunctionBinding_h
23 #define CastingFunctionBinding_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
44 template< class T, typename R, typename O >
46 public:
48  typedef O(T::* Operation)() const;
49 
50  CastingFunctionBinding(T* source, Operation operation) :
51  mySource(source),
52  myOperation(operation) {}
53 
56 
57  R getValue() const {
58  return (R)(mySource->*myOperation)();
59  }
60 
61  ValueSource<R>* copy() const {
63  }
64 
67  }
68 
69 protected:
70 
71 private:
74 
77 };
78 
79 
80 #endif
81 
82 /****************************************************************************/
83 
ValueSource< SUMOReal > * makeSUMORealReturningCopy() const
CastingFunctionBinding(T *source, Operation operation)
T * mySource
The object the action is directed to.
Operation myOperation
The object's operation to perform.
O(T::* Operation)() const
Type of the function to execute.
ValueSource< R > * copy() const