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
CastingFunctionBinding.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// »missingDescription«
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2012 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
35
#include <
utils/common/ValueSource.h
>
36
37
38
// ===========================================================================
39
// class definitions
40
// ===========================================================================
44
template
<
class
T,
typename
R,
typename
O >
45
class
CastingFunctionBinding
:
public
ValueSource
<R> {
46
public
:
48
typedef
O(T::*
Operation
)()
const
;
49
50
CastingFunctionBinding
(T* source,
Operation
operation) :
51
mySource
(source),
52
myOperation
(operation) {}
53
55
~CastingFunctionBinding
() {}
56
57
R
getValue
()
const
{
58
return
(R)(
mySource
->*
myOperation
)();
59
}
60
61
ValueSource<R>
*
copy
()
const
{
62
return
new
CastingFunctionBinding<T, R, O>
(
mySource
,
myOperation
);
63
}
64
65
ValueSource<SUMOReal>
*
makeSUMORealReturningCopy
()
const
{
66
return
new
CastingFunctionBinding<T, SUMOReal, O>
(
mySource
,
myOperation
);
67
}
68
69
protected
:
70
71
private
:
73
T*
mySource
;
74
76
Operation
myOperation
;
77
};
78
79
80
#endif
81
82
/****************************************************************************/
83
var
build
temp
tmp.znCyBrHNjL
4.0-0-0
sumo
sumo-0.15.0~dfsg
src
microsim
logging
CastingFunctionBinding.h
Generated on Mon Mar 24 2014 09:53:08 for SUMO - Simulation of Urban MObility by
1.8.1.2