[ 
https://issues.apache.org/jira/browse/MESOS-5428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Pravat updated MESOS-5428:
---------------------------------
    Description: 
If a program exeposes flags,  the recommendation from Mesos was to use a 
derived class from FlagsBase, add the new flags in constructor.
As benefit  the new `Flags` class `inherits` all the flags from the derived 
classes.
Each derived calss calls the method `add` implemented in `FlagsBase` which uses 
`dynamic_cast` to set the default value and other things.

To use the use `FlagsBase` in Visual Studio  we should disable construction 
displacements using `/vd2` compile option. 
More info: https://msdn.microsoft.com/en-us/library/7sf3txa8.aspx

  was:
If a program exeposes flags,  the recommendation from Mesos was to use a 
derived class from FlagsBase, add the new flags in constructor.
As benefit  the new `Flags` class `inherits` all the flags from the derived 
classes.
Each derived calss calls the method `add` implemented in `FlagsBase` which uses 
`dynamic_cast` to set the default value and other things.

Since the constructor is not completed class is not completed (in Visual Studio 
the vtable is not correct at that time) the code does not work on Windows.
We should have to call a separate method in Windows.


> Update the mechanism to define flags in FlagsBase derived clases
> ----------------------------------------------------------------
>
>                 Key: MESOS-5428
>                 URL: https://issues.apache.org/jira/browse/MESOS-5428
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Daniel Pravat
>
> If a program exeposes flags,  the recommendation from Mesos was to use a 
> derived class from FlagsBase, add the new flags in constructor.
> As benefit  the new `Flags` class `inherits` all the flags from the derived 
> classes.
> Each derived calss calls the method `add` implemented in `FlagsBase` which 
> uses `dynamic_cast` to set the default value and other things.
> To use the use `FlagsBase` in Visual Studio  we should disable construction 
> displacements using `/vd2` compile option. 
> More info: https://msdn.microsoft.com/en-us/library/7sf3txa8.aspx



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

Reply via email to