Officer shoots, kills man who attacked family