cppgenerator: Make factories to be autogenerated

Change-Id: Iae97b289e379f64fb66a14566d3a03996b586d2d