Esempio n. 1
0
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;
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
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");
}
Esempio n. 4
0
 void operator() (attribute const& attr) const
 {
     names_.insert(attr.name());
 }
Esempio n. 5
0
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( ) + "'" );
}
Esempio n. 6
0
 void operator() (attribute const& attr) const
 {
     str_ += "[";
     str_ += attr.name();
     str_ += "]";
 }
Esempio n. 7
0
 void operator() (attribute const& attr) const
 {
     // convert mapnik::value to std::string
     value const& val = feature_.get(attr.name());
     filename_ += val.to_string();
 }
Esempio n. 8
0
string xmlString::getAttribute( const attribute &attr )
    {
    return attr.identifier() + "=\"" + attr.value().toString() + "\"";
    }
Esempio n. 9
0
inline T attribute_cast(attribute const& attr)
{
    return T(attributes::cast_source(attr.get_impl()));
}
Esempio n. 10
0
bool attribute::operator < (attribute &a)
{
    if(strcmp(m_name,a.get_name()) < 0)
        return true;
    return false;
}
Esempio n. 11
0
 void operator() (attribute const& attr) const
 {
     names_.emplace(attr.name());
 }