[SAGA-RG] Question about attributes in SAGA C++

Andre Merzky andre at merzky.net
Mon Dec 22 18:13:16 CST 2008


Quoting [Livesey, P (Paul)] (Dec 18 2008):
> 
> Hi all,

Hi Paul, 

> I'm not sure if this is the correct place to post but I'll try anyway!

A better place may have been the bug tracker for the saga
C++ implementation, at: http://fortytwo.cct.lsu.edu:8000/SAGA/ 
(there is a guest/guest account).


> I'm working with what I believe is the latest version (from svn) of the C++ SAGA implementation and have come across some rather curious behaviour.
> 
> If I try and set a scalar attribute that doesn't already exist with set_attribute(key, value) 
> 
> I end up (after a while) in 
> 
> void attribute_cache::set_attribute (const std::string & key,
>                                      const std::string & val)
> 
> which creates a vector attribute if the one I ask for doesn't currently exist.
> 
>       a_map_type::iterator ai = a_map_.find (key);
>       if (a_map_.end() == ai)
>       {
>         BOOST_ASSERT(extensible_);
>     
>         // does not exist, and need to be created
>         a_map_[key] = attrib (key, val, saga::impl::attrib::Vector, 
>                               false, true);
>       }
>       else
>       {
>         // make sure this is a not vector attribute (as required by the latest spec)
>         if (ai->second.is_vec())
>         {
>           SAGA_THROW("attribute '" + key + "' is a vector attribute", 
>             saga::IncorrectState);
>         }
> 
> This is causing me a few problems and I was wondering if it's intentional.

This looks like a bug indeed - I wonder why it did not come
up earlier *scratch*.  I'll file a ticket, and will let you
know as soon as it is fixed.

Thanks for the report!

Andre.


> Regards,
> 
> Paul.
-- 
Nothing is ever easy.


More information about the saga-rg mailing list