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

Livesey, P (Paul) paul.livesey at stfc.ac.uk
Thu Dec 18 09:13:26 CST 2008


Hi all,

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

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.

Regards,

Paul.
-- 
Scanned by iCritical.


More information about the saga-rg mailing list