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; }
bool attribute_cache::attribute_is_writable (const std::string & key ) const { return ( ! attribute_is_readonly (key) ); }