x

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"

What is connection beteween UCLASS and UOBJECT? How does this connection work?

What is connection beteween UCLASS and UOBJECT? How does this connection work? I am trying to understand how this mechanism work... Thank you in advance...

Product Version: UE 4.10
Tags:
more ▼

asked Mar 04 '16 at 07:22 PM in C++ Programming

avatar image

Wilq83
23 5 7 9

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

1 answer: sort voted first

UObject class is the base class for almost all the classes in unreal for ex, AActor,UActorComponent and so on, UClass is also derived from UObject. Now whenever you mark any of your classes with a UCLASS() what it does is it generates the UClass for that UObject that is it generates reflection code for that UObject Class.

Now what do you mean by reflection code? read it here its in context to java but will give you an idea

Now since C++ hasnt got any inbuilt reflection system thats why we have to mark classes and functions and even properties with Umacros that is UCLASS() ,UFUNCTION(),UPROPERTY() so that we get the reflection code generated for them.

Then what is UClass basically? So the type you use in java for reflection code sometimes for ex,

 Class lostClass=someClass.getClass();

is Class ,so basically UClass is a substitute for Class in the Unreal version of C++, so that you could do sething like

      UClass TestClass = SomeUObjectClass.GetClass();
 /// And then you can query about its name or even call methods on this class

Hope you understand it :)

more ▼

answered Jul 20 '18 at 07:11 AM

avatar image

luGo0
10 3 4 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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