Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Unreal class name prefix is giving me trouble

Unreal class name prefix law is really giving me hell.

 template<typename UnrealClass, typename SyncClass>
 class GLogicNode : public IGEventListener<UnrealClass>

I want this class GLogicNode to utilize the TWeakObjectPtr functionality of unreal. So GLogicNode has to be a subclass of UObject, but I want something more. I want this GLogicNode can inherit any subclass of UObject, like this:

 class FGameSystemNode : public GLogicNode<UObject, MainThreadSyncCore> { };
 class FGameActorNode : public GLogicNode<AActor, MainThreadSyncCore> { };

those two lines actually compiles. but it's just a delusion:

UnrealClass changes from AActor to UObject and Widget, the the prefix of GLogicNode is not gonna fit. When I make another class, it finally failed in compilation.

 class FGAME_API ULogicCore : public GLogicNode<UObject, MainThreadSyncCore>

the compiler complained about the prefix...

So my question is where should I been looking to get over the prefix problem? You know Unreal AActor is directly inherited from UObject.

 UCLASS(BlueprintType, Blueprintable, config=Engine, meta=(ShortTooltip="An Actor is an object that can be placed or spawned in the world."))
 class ENGINE_API AActor : public UObject

Product Version: UE 4.20
more ▼

asked Aug 19 '18 at 02:27 PM in C++ Programming

avatar image

1 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question