Elements
6.0.1
A C++ base framework for the Euclid Software.
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
ElementsExamples
src
lib
default
callBackExample.cpp
Go to the documentation of this file.
1
22
#include <functional>
// for function
23
#include <vector>
// for vector
24
25
#include "
ElementsKernel/Logging.h
"
// for Logging
26
27
#include "
ElementsExamples/callBackExample.h
"
28
29
using
std::vector
;
30
31
namespace
Elements {
32
namespace
Examples {
33
34
double
testCallBack
(
vector<double>
x,
const
std::function
<
double
(
vector<double>
)>& fun) {
35
36
auto
log
=
Logging::getLogger
(
"ElementsExamples"
);
37
38
log
.info() <<
"Calling the Python function from C++"
;
39
40
double
f = fun(x);
41
42
log
.info() <<
"The value of the function is "
<< f;
43
44
log
.info() <<
"Returning the result"
;
45
46
return
(f);
47
}
48
49
}
// namespace Examples
50
}
// namespace Elements
std::function
Logging.h
Logging facility.
callBackExample.h
Elements::Examples::log
auto log
Definition:
BackTraceExample.cpp:36
Elements::Examples::testCallBack
ELEMENTS_API double testCallBack(std::vector< double > x, const std::function< double(std::vector< double >)> &fun)
Definition:
callBackExample.cpp:34
std::vector
STL class.
Elements::Logging::getLogger
static Logging getLogger(const std::string &name="")
Definition:
Logging.cpp:63
Generated by
1.8.5