void attribute_map::add_attribute( const attribute& newAttrib ) { if( !m_defining ) { throw std::runtime_error( "attribute_map.add_attribute: Failed to add attribut(" + newAttrib.get_name() + ") because attribute map is not being defined." ); } if( m_attribNames.find( newAttrib.get_name() ) != m_attribNames.end() ) { throw std::runtime_error( "attribute_map.add_attribute: Failed to add attribute(" + newAttrib.get_name() + ") because attribute map already has an attribute of the same name." ); } m_attributes.push_back( newAttrib ); m_attribNames.insert( newAttrib.get_name() ); ++m_attribCount; }
std::size_t attribute_hasher::hash(const attribute&v) { std::size_t seed(0); combine(seed, v.name()); combine(seed, hash_std_vector_boost_variant_dogen_dia_color_dogen_dia_real_dogen_dia_integer_dogen_dia_font_dogen_dia_boolean_dogen_dia_point_dogen_dia_string_dogen_dia_enumeration_dogen_dia_rectangle_dogen_dia_composite_(v.values())); return seed; }
void configuration_builder::create_on_event(attribute const &key, attribute_list const &event) { dataframe_tracker::iterator it; bool ok; std::tie(it, ok) = m_configuration.insert(event, m_index_mapping.begin(), m_index_mapping.end()); if(!ok) throw std::runtime_error("attempted to create a particle with a key " + key.nice_string() + " that is already present"); }
void operator() (attribute const& attr) const { names_.insert(attr.name()); }
void verify_attribute_name( const attribute& attr, const string& name_expected ) { if( attr.get_name( ) != name_expected ) throw runtime_error( "expecting attribute named '" + name_expected + "' but found attribute named '" + attr.get_name( ) + "'" ); }
void operator() (attribute const& attr) const { str_ += "["; str_ += attr.name(); str_ += "]"; }
void operator() (attribute const& attr) const { // convert mapnik::value to std::string value const& val = feature_.get(attr.name()); filename_ += val.to_string(); }
string xmlString::getAttribute( const attribute &attr ) { return attr.identifier() + "=\"" + attr.value().toString() + "\""; }
inline T attribute_cast(attribute const& attr) { return T(attributes::cast_source(attr.get_impl())); }
bool attribute::operator < (attribute &a) { if(strcmp(m_name,a.get_name()) < 0) return true; return false; }
void operator() (attribute const& attr) const { names_.emplace(attr.name()); }