Skip to content
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

Add description for Property and commandline generation #623

Merged
merged 2 commits into from
Dec 5, 2018

Conversation

tribal-tec
Copy link
Contributor

No description provided.

Copy link
Contributor

@karjonas karjonas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to make the constructor of a property work without explicitly typing out the UserInfo type like: Property({"prop", "value", {"label", "description"}})?

brayns/common/PropertyMap.h Outdated Show resolved Hide resolved
brayns/common/PropertyMap.h Outdated Show resolved Hide resolved
@tribal-tec
Copy link
Contributor Author

ping

karjonas
karjonas previously approved these changes Dec 3, 2018
@tribal-tec
Copy link
Contributor Author

Had another iteration where I added generic support for enums (with one minor limitation for integer enums), provided more docs & tests, and fix the casing (camelCase property to hyphenated-case for cmdline option).

@tribal-tec
Copy link
Contributor Author

retest this please

brayns/common/PropertyMap.h Show resolved Hide resolved
{
public:
PropertyMap() = default;
enum class Type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lowercase members?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a different refactoring, no?

{
assertValidType<T>();

if (std::is_same<T, double>::value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use if constexpr if it wasn't C++17, but the compiler should be able to optimize out the dead branches anyway.

template <typename T>
T _castValue(const boost::any& v) const
{
_checkType<T>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for not relying on boost::bad_cast? If is performing undesired type promotions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know. I moved the code only, @karjonas was the original author of that.

brayns/common/commandlinePropertyMap.h Outdated Show resolved Hide resolved
brayns/common/commandlinePropertyMap.cpp Outdated Show resolved Hide resolved
brayns/common/commandlinePropertyMap.h Outdated Show resolved Hide resolved
plugins/VRPN/VRPNPlugin.cpp Show resolved Hide resolved
tests/propertyMap.cpp Show resolved Hide resolved
brayns/common/utils/Utils.cpp Show resolved Hide resolved
@hernando hernando merged commit d06a26f into BlueBrain:master Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants