New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose AnyParameter map to C++ API and extend in SWIG #4479
Changes from all commits
8cf9cef
0b5e8ea
b9edc08
b23659f
2e73bdf
88178c2
d1559b9
caa0129
d41e007
bd062c0
06b4878
86f4103
daa6c9f
c77fb54
8bf4f6f
391c8de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
|
||
#include <utility> | ||
#include <vector> | ||
#include <map> | ||
|
||
/** \namespace shogun | ||
* @brief all of classes and functions are contained in the shogun namespace | ||
|
@@ -79,14 +80,13 @@ template <class T> class SGStringList; | |
#define VARARG_IMPL(base, count, ...) VARARG_IMPL2(base, count, __VA_ARGS__) | ||
#define VARARG(base, ...) VARARG_IMPL(base, VA_NARGS(__VA_ARGS__), __VA_ARGS__) | ||
|
||
#define SG_ADD3(param, name, description) \ | ||
#define SG_ADD3(param, name, description) \ | ||
{ \ | ||
this->m_parameters->add(param, name, description); \ | ||
this->watch_param( \ | ||
name, param, AnyParameterProperties()); \ | ||
this->watch_param(name, param, AnyParameterProperties(description)); \ | ||
} | ||
|
||
#define SG_ADD4(param, name, description, param_properties) \ | ||
#define SG_ADD4(param, name, description, param_properties) \ | ||
{ \ | ||
AnyParameterProperties pprop = \ | ||
AnyParameterProperties(description, param_properties); \ | ||
|
@@ -533,11 +533,13 @@ class CSGObject | |
*/ | ||
virtual std::string to_string() const; | ||
|
||
/** Returns set of all parameter names of the object. | ||
/** Returns map of parameter names and AnyParameter pairs | ||
* of the object. | ||
* | ||
*/ | ||
std::vector<std::string> parameter_names() const; | ||
|
||
#ifndef SWIG // SWIG should skip this part | ||
std::map<std::string, std::shared_ptr<const AnyParameter>> get_params() const; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doxygen string would be good, like what is this method doing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh it's already there but I put the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah sorry I didnt see |
||
#endif | ||
/** Specializes a provided object to the specified type. | ||
* Throws exception if the object cannot be specialized. | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Of type” maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, I had that at first but then for some reason sounded weird, but I agree that is better!