mlpack  3.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
get_printable_type.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_MARKDOWN_GET_PRINTABLE_TYPE_HPP
14 #define MLPACK_BINDINGS_MARKDOWN_GET_PRINTABLE_TYPE_HPP
15 
16 #include "binding_info.hpp"
17 
22 
23 namespace mlpack {
24 namespace bindings {
25 namespace markdown {
26 
31 template<typename T>
33  const void* /* input */,
34  void* output)
35 {
36  if (BindingInfo::Language() == "cli")
37  {
38  *((std::string*) output) =
39  cli::GetPrintableType<typename std::remove_pointer<T>::type>(data);
40  }
41  else if (BindingInfo::Language() == "python")
42  {
43  *((std::string*) output) =
44  python::GetPrintableType<typename std::remove_pointer<T>::type>(data);
45  }
46  else if (BindingInfo::Language() == "julia")
47  {
48  *((std::string*) output) =
49  julia::GetPrintableType<typename std::remove_pointer<T>::type>(data);
50  }
51  else if (BindingInfo::Language() == "go")
52  {
53  *((std::string*) output) =
54  go::GetPrintableType<typename std::remove_pointer<T>::type>(data);
55  }
56  else
57  {
58  throw std::invalid_argument("GetPrintableType(): unknown "
59  "BindingInfo::Language(): " + BindingInfo::Language() + "!");
60  }
61 }
62 
67 template<typename T>
69 {
70  std::string output;
71  GetPrintableType<T>(data, (void*) NULL, (void*) &output);
72  return output;
73 }
74 
75 } // namespace markdown
76 } // namespace bindings
77 } // namespace mlpack
78 
79 #endif
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
static std::string & Language()
Get or modify the current language (don&#39;t set it to something invalid!).
void GetPrintableType(const util::ParamData &data, const void *, void *output)
Print the type of a parameter into the output string.
string(REGEX REPLACE".*#define MLPACK_VERSION_MINOR ([0-9]+).*""\\1"MLPACK_VERSION_MINOR"${VERSION_HPP_CONTENTS}") string(REGEX REPLACE".* "\\1" MLPACK_VERSION_PATCH "$
Definition: CMakeLists.txt:56