Hi,

On Tue, 2008-05-13 at 16:32 -0500, Carsten Neumann wrote:
>       Hi,
> 
> Gerrit Voss wrote:
> > On Fri, 2008-05-09 at 10:10 -0500, Carsten Neumann wrote:
> >> I've redone the way options are handled by the {Image,Scene}FileHandler 
> >> and propose attached patch. The main changes are:
> >>
> >> - an option is a name (std::string) and a value (boost::any)
> >> - an option set is a map from name (std::string) to option
> >> - {Image,Scene}FileType derive from a common base class (IOFileTypeBase) 
> >> which holds a stack of option sets that always contains at least one 
> >> element (the current option set).
> >> - IOFileTypeBase has some convenience access functions to retrieve 
> >> options and their values.
> >>
> >> Most loaders have an internal representation for options as well (mainly 
> >> osb, wrl) which has not been touched except for adjusting the functions 
> >> that translate the option set into the internal rep.
> > 
> > 
> > that does not look right.
> > 
> > boost::any const &
> >     IOFileTypeBase::getOption(std::string const &name) const
> > {
> >     OptionSet::const_iterator oIt = _optStack.top().find(name);
> >     
> >     oIt->second;
> > }
> 
> why? because it does not check for oIt == _optStack.top().end() ? This 
> as well as the corresponding getOptionAs<> are intended for when it is 
> known that the option is present - the doxy comment has a warning about 
> this.

no because it does not return anything, the return statement is 
missing. I wasn't sure if there is just something simple missing or
if there is more to it. Especially as return gIt->second would return
a reference to a temporary.

kind regards,
  gerrit



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to