[ 
https://issues.apache.org/jira/browse/MESOS-5841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15375459#comment-15375459
 ] 

Greg Mann commented on MESOS-5841:
----------------------------------

One option would be to get rid of all the overloads except for 
`FlagsBase::add(const Flag& flag)`, add a couple helper functions for modifying 
`Flag` objects, and construct flag objects in the 'flags.cpp' files:

{code}
Flag flag;
flag.name = "work_dir";
flag.help = help_string;
flag.set_storage(&Flags::work_dir); // New helper
flag.set_validation(lambda_function); // New helper
{code}

> Clean up `FlagsBase::add`
> -------------------------
>
>                 Key: MESOS-5841
>                 URL: https://issues.apache.org/jira/browse/MESOS-5841
>             Project: Mesos
>          Issue Type: Improvement
>          Components: stout
>    Affects Versions: 1.0.0
>            Reporter: Greg Mann
>              Labels: mesosphere
>
> In the definition for {{FlagsBase}}, we currently have 20 overloads for the 
> {{FlagsBase::add}} function. This makes both the {{FlagsBase}} class 
> definition and the {{flags.cpp}} files in Mesos difficult to read. We should 
> clean up {{FlagsBase::add}} so that it does not require so many overloads.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to