Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE][DOCS] Incorrect documentation on class reflection in behavior context #2548

Open
lgleim opened this issue Mar 20, 2024 · 2 comments
Open
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@lgleim
Copy link
Contributor

lgleim commented Mar 20, 2024

Describe the issue

The Behavior Context documentation for classes states that one should specify base classes via a second template argument if applicable, however the current implementation only supports a single template argument.

Impacted page(s)

https://development--o3deorg.netlify.app/docs/user-guide/programming/components/reflection/behavior-context/#classes

Expected experience

  1. That the limited documentation for the (anyway hard to grasp reflection system) is correct.
  2. A proper explanation how to deal with reflecting hierarchies of classes
@lgleim lgleim added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 20, 2024
@lgleim
Copy link
Contributor Author

lgleim commented Mar 20, 2024

@lemonade-dm Since you committed the BehaviorClassBuilder, could you by any chance provide some insights on what the proper resolution to this could be?

@lemonade-dm
Copy link
Contributor

Actually the documentation for the BehaviorContext class has always been incorrect.
It never accepted the base class as a template parameter. Only the SerializeContext supplied base classes through the template parameters.

Instead the BehaviorContext gathers the Base Classes through using the AZ RTTI system by querying the base classes recursively associated with the primary registered class T rtti info via a call to AZ::RttiEnumHierarchy.

As the RTTI hierarchy is setup through the AZ_RTTI macro when creating a class, any class that uses macro has its base classes visited recursively.

If a class doesn't specify the AZ_RTTI macro, then any base class hierarchy will not be known to the BehaviorContext.

@ShaunaGordon ShaunaGordon added kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants