The aim of this work is to present new approach to study weighted pseudo almost periodic and automorphic functions using the measure theory. We present a new concept of weighted ergodic functions which is more general than the classical one. Then we establish many interesting results on the functional space of such functions. We study the existence and uniqueness of μ-pseudo almost periodic and automorphic solutions of class r for some neutral partial functional differential equations in a Banach space when the delay is distributed using the spectral decomposition of the phase space developed in Adimy and co-authors. Here we assume that the undelayed part is not necessarily densely defined and satisfies the well-known Hille-Yosida condition, the delayed part are assumed to be pseudo almost periodic or pseudo almost automorphic with respect to the first argument and Lipschitz continuous with respect o the second argument.