[C++]Getting Components from BluePrint using C++

Thanks JamesG for your reply, i had thought this might be a workaround but it would not be ideal (unless i misunderstood, but that will call every AModuleConnector)
I only wish to find the AModuleConnector Actors of a specific Module piece.


A = AModule (Custom blueprint made under Module class) , B = ChildActor with AModuleConnector , C = ChildActor with AModuleConnector

Here is the AModule Components Blueprint. When the member function of AModule FindExits() is called i need it to return a TArray with B and C (or if there is more AModuleConnectors those as well) inside of it.

Additionally, is a Child Actor (selected from add component in the BP editor) both an actor and a component?
Thanks!

Edit:


TArray<AModuleConnector*> AModule::GetExits()
{
	TArray<AModuleConnector*> comps;
	UWorld* const World = GetWorld();
	for (TActorIterator<AModuleConnector> It(World); It; ++It)
	{
		AModuleConnector* ModCon = *It;
		if (ModCon && ModCon->GetAttachParentActor() == this)
		{
			comps.Add(ModCon);
		}
	}

	return comps;
}


This seems to work, not sure if its the most clean way. Thanks.