get_param.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_BINDINGS_TESTS_GET_PARAM_HPP
13 #define MLPACK_BINDINGS_TESTS_GET_PARAM_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace bindings {
19 namespace tests {
20 
25 template<typename T>
27 {
28  // No mapping is needed, so just cast it directly.
29  return *boost::any_cast<T>(&d.value);
30 }
31 
40 template<typename T>
41 void GetParam(util::ParamData& d, const void* /* input */, void* output)
42 {
43  // Cast to the correct type.
44  *((T**) output) = &GetParam<T>(const_cast<util::ParamData&>(d));
45 }
46 
47 } // namespace tests
48 } // namespace bindings
49 } // namespace mlpack
50 
51 #endif
boost::any value
The actual value that is held.
Definition: param_data.hpp:79
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
T & GetParam(util::ParamData &d)
This overload is called when nothing special needs to happen to the name of the parameter.
Definition: get_param.hpp:26
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52