> What is the goal ?
With the
flags, you can extend
vars properties in the future
> Performance ?
You have a supplementary filtering code, so evidently less preformance
> Ease of use ?
Yes, one line code, and
CompileOptionsBase do the filtering, not the caller :
for ( CustomVarHash::const_iterator * it = object->VarEnumGetFirst(properties_flags) ; it != nullptr ; it = object->VarEnumGetNext() )
> Why don't you return a vector/array with the CustomVar struct ?
That is interesting ; I made that because I could not return the
wxHashMap directly ; And I didnt want to build a filtered
wxHashMap and return it ( heavy object, and the existing C::B code that calls
GetAllVars() enumerates the keys, but dont uses the mapping feature). But a vector, why not ? Something like this :
virtual vector< CustomVar const & > VarGetAll(int _i_flags = eVarActive) const;
I just didnt think at it
. I do this and I post on github so the code can be reviewed.
By the way the name "
CustomVar" in the global namespace is not satisfying to me.
CompileOptionsBase::Var would be logically OK but it is heavy ? Does someone have a replacement / suggestion to make.