예제 #1
0
    void attributes::set_attribute (std::string key, 
                                    std::string val)
    {
      if ( ! extensible_ &&
           ! attribute_exists (key, false) )
      {
        throw saga::DoesNotExist (key + ": attribute does not exist");
      }

      if ( attribute_exists    (key, false) &&
           attribute_is_vector (key, false) )
      {
        throw saga::IncorrectState (key + ": is vector attribute");
      }

      if ( attribute_exists      (key, false) &&
           attribute_is_readonly (key, false) )
      {
        throw saga::ReadOnly (key + ": attribute is readonly");
      }

      // all checks ok, set attrib
      attribs_s_[key] = val;
    }
예제 #2
0
 bool attribute_cache::attribute_is_writable (const std::string & key ) const
 {
     return ( ! attribute_is_readonly (key) );
 }