Hilbert function, generalized Poincaré series and topology of plane valuations