[Closed] Interface as UPROPERTY, class member? [C++]
To create an interface you must create two classes, one with the macro UINTERFACE which is deriving UInterface and one "normal" class that contains all the interface's pure virtual methods. Is this correct understood? source: https://answers.unrealengine.com/questions/4083/question-c-interfaces.html.
When I have created my interface it seems like it can't be used as a UPROPERTY and therefore not automatically added to the garbage collector. What type of pointer should one use to make a UINTERFACE a member of an other UCLASS such that it's managed by the garbage collector and references are increased and decreased properly? Is there some equivalent to
As a side note: I also tried to make an abstract UCLASS but seems like an UCLASS can't have pure virtual members even though it's created with UCLASS(Abstract). This seems a bit weird to me since having abstract/pure virtual methods is pretty much what makes an abstract class abstract except in some special cases. I get the following compilation error message:
where UGUIComponent is my class with the method
asked Apr 08 '14 at 01:00 PM in C++ Programming
The question has been closed Jul 23 '14 at 12:51 PM by undercover for the following reason:
The question is answered, right answer was accepted
You use multiple inheritance with interfaces, so for any class you want to implement an interface, you add the additional inheritance.
I have entire instructions and complete tutorial on interfaces here:
UE4 Interfaces Wiki
answered Apr 08 '14 at 01:45 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here