SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FunctionBinding.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // »missingDescription«
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef FunctionBinding_h
24 #define FunctionBinding_h
25 
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
38 #include "CastingFunctionBinding.h"
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
47 template< class T, typename R >
48 class FunctionBinding : public ValueSource<R> {
49 public:
51  typedef R(T::* Operation)() const;
52 
53  FunctionBinding(T* const source, Operation operation) :
54  mySource(source),
55  myOperation(operation) {}
56 
59 
60  R getValue() const {
61  return (mySource->*myOperation)();
62  }
63 
64  ValueSource<R>* copy() const {
66  }
67 
70  }
71 
72 private:
75 
78 };
79 
80 
81 #endif
82 
83 /****************************************************************************/
84