default_param.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_MARKDOWN_DEFAULT_PARAM_HPP
14 #define MLPACK_BINDINGS_MARKDOWN_DEFAULT_PARAM_HPP
15 
16 #include "binding_info.hpp"
17 
20 
21 namespace mlpack {
22 namespace bindings {
23 namespace markdown {
24 
29 template<typename T>
30 void DefaultParam(const util::ParamData& data,
31  const void* /* input */,
32  void* output)
33 {
34  if (BindingInfo::Language() == "cli")
35  {
36  *((std::string*) output) =
37  cli::DefaultParamImpl<typename std::remove_pointer<T>::type>(data);
38  }
39  else if (BindingInfo::Language() == "python")
40  {
41  *((std::string*) output) =
42  python::DefaultParamImpl<typename std::remove_pointer<T>::type>(data);
43  }
44 }
45 
46 } // namespace markdown
47 } // namespace bindings
48 } // namespace mlpack
49 
50 #endif
.hpp
Definition: add_to_po.hpp:21
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
void DefaultParam(const util::ParamData &data, const void *, void *output)
Print the default value of a parameter into the output string.
static std::string & Language()
Get or modify the current language (don&#39;t set it to something invalid!).