Need Help With Coding Please

I removed the following code from my child theme functions.php because it was throwing this error:

Fatal error: Call to undefined function bp_loggedin_user_domain() in /themes/generatepress_child/functions.php on line 47

// Begin - BuddyPress Shortcodes For Profiles
add_shortcode( 'bp_user_profile_link', 'bp_user_profile_link_shortcode');
function bp_user_profile_link_shortcode( $atts ){
$atts = shortcode_atts( array(
'text' => 'Profile',
'target' => ''
), $atts );
if( !is_user_logged_in() )
return '';
$target_link = bp_loggedin_user_domain();
switch( $atts['target'] ){
case 'settings' : $target_link .= 'settings/'; break;
case 'profile' : $target_link .= 'profile/'; break;
case 'edit_profile' : $target_link .= 'profile/edit/'; break;
}
return "" . $atts['text'] . "";
}
// End - BuddyPress Shortcodes For Profiles

Can you please tell me how to fix this error. Thank you.