mlpack  3.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
print_type_doc.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_MARKDOWN_PRINT_TYPE_DOC_HPP
14 #define MLPACK_BINDINGS_MARKDOWN_PRINT_TYPE_DOC_HPP
15 
16 #include "binding_info.hpp"
17 
20 
21 namespace mlpack {
22 namespace bindings {
23 namespace markdown {
24 
29 template<typename T>
30 std::string PrintTypeDoc(const util::ParamData& data)
31 {
32  if (BindingInfo::Language() == "cli")
33  {
34  return cli::PrintTypeDoc<typename std::remove_pointer<T>::type>(data);
35  }
36  else if (BindingInfo::Language() == "python")
37  {
38  return python::PrintTypeDoc<typename std::remove_pointer<T>::type>(data);
39  }
40  else
41  {
42  throw std::invalid_argument("PrintTypeDoc(): unknown "
43  "BindingInfo::Language() " + BindingInfo::Language() + "!");
44  }
45 }
46 
47 } // namespace markdown
48 } // namespace bindings
49 } // namespace mlpack
50 
51 #endif
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
std::string PrintTypeDoc(const util::ParamData &data)
Print the type 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!).