Beispiel #1
0
		MGVTBL* get_object_vtbl(const std::type_info& pre_key, int (*destruct_ptr)(pTHX_ SV*, MAGIC*)) {
			static boost::ptr_map<const std::type_info*, MGVTBL> table;
			const std::type_info* key = &pre_key;
			if (table.find(key) == table.end()) {
				const MGVTBL tmp = {0, 0, 0, 0, destruct_ptr MAGIC_TAIL};
				table.insert(key, new MGVTBL(tmp));
			}
			return &table[key];
		}
Beispiel #2
0
void AddBindingImpl::operator()( boost::ptr_map<AttributeKey,Expression> & bindings, AttributeKey att, Expression * exp ) const {
	if ( att == AttributeKey::UNDEFINED && dynamic_cast<AttributeExpression*>( exp ) ) {
		bindings.insert( static_cast<AttributeExpression*>( exp )->attribute, exp ); // Если у аттрибута не указано связывание, связываем его с соответствующим аттрибутом
	} else if ( att == AttributeKey::UNDEFINED && dynamic_cast<ConcatenationExpression*>( exp ) ) {
		bindings.insert( att = AttributeKey::TEXT, exp ); // Если у текстового выражения не указано связывание, связываем его с аттрибутом TEXT
	} else {
		bindings.insert( att, exp );
	}
}
Beispiel #3
0
void insertOrReplace( boost::ptr_map<std::string, Geometry >& map, std::string key, Geometry* value )
{
    boost::ptr_map<std::string, Geometry >::iterator found =  map.find( key );

    if ( found != map.end() ) {
        map.erase( found );
    }

    map.insert( key, value );
}
		void insert(boost::ptr_map<K, V>  &arg_ptr_map,  ///< The ptr_map into which the key/value should be inserted
		            K                      arg_key,      ///< The key to insert
		            std::unique_ptr<V>   &&arg_ptr_value ///< The associated value to insert, held by unique_ptr
		            ) {
			arg_ptr_map.insert( arg_key, arg_ptr_value.release() );
		}