General class of models for recurrent event data