Change cpp factory registrar from list to map

Change-Id: I51e4b0a264cb1997b987a004453af493ddab51cd