pass component class by ref (not value) in edge-based graph factory