SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
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-2013 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
37
#include <
utils/common/ValueSource.h
>
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
58
~FunctionBinding
() {}
59
60
R
getValue
()
const
{
61
return
(
mySource
->*
myOperation
)();
62
}
63
64
ValueSource<R>
*
copy
()
const
{
65
return
new
FunctionBinding<T, R>
(
mySource
,
myOperation
);
66
}
67
68
ValueSource<SUMOReal>
*
makeSUMORealReturningCopy
()
const
{
69
return
new
CastingFunctionBinding<T, SUMOReal, R>
(
mySource
,
myOperation
);
70
}
71
72
private
:
74
T*
mySource
;
75
77
Operation
myOperation
;
78
};
79
80
81
#endif
82
83
/****************************************************************************/
84
home
gladk
tmp
05
sumo-0.17.1~dfsg
src
microsim
logging
FunctionBinding.h
Generated on Sun Jun 16 2013 07:07:02 for SUMO - Simulation of Urban MObility by
1.8.1.2