How to check if a selected made in C++ attachable actor component is added to a blueprint class in unreal engine C++ coding?

Hey, I was making a health increaser component for my game, that could be attached to a actor that is supposed to work as a food, I was making a logic in C++ in the player character class to check if the raycast hits any blueprint class that contains health increaser actor component attached to it. Like a “Actor->GetClass->IsChildOf” is used for checking that a class is the child of a Selected C++ class, is there any function for C++ attachable components that finds their blueprint classes that have attached the C++ component on it?