mlpack  3.1.1
 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 
21 
22 namespace mlpack {
23 namespace bindings {
24 namespace markdown {
25 
30 template<typename T>
32  const void* /* input */,
33  void* output)
34 {
35  if (BindingInfo::Language() == "cli")
36  {
37  *((std::string*) output) =
38  cli::GetPrintableType<typename std::remove_pointer<T>::type>(data);
39  }
40  else if (BindingInfo::Language() == "python")
41  {
42  *((std::string*) output) =
43  python::GetPrintableType<typename std::remove_pointer<T>::type>(data);
44  }
45  else if (BindingInfo::Language() == "julia")
46  {
47  *((std::string*) output) =
48  julia::GetPrintableType<typename std::remove_pointer<T>::type>(data);
49  }
50  else
51  {
52  throw std::invalid_argument("GetPrintableType(): unknown "
53  "BindingInfo::Language(): " + BindingInfo::Language() + "!");
54  }
55 }
56 
61 template<typename T>
63 {
64  std::string output;
65  GetPrintableType<T>(data, (void*) NULL, (void*) &output);
66  return output;
67 }
68 
69 } // namespace markdown
70 } // namespace bindings
71 } // namespace mlpack
72 
73 #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:35