Closed hydexon closed 7 years ago
1)
So your first question is, whether it is allowed to register your reflection data also outside of RTTR_REGISTRATION inside any arbitrary code section?
Yes, it is possible, but I don't see the benefit of it. What is you actual use case?
At the moment the registration process has not mutex, so it is not thread safe, but when everything is called with RTTR_REGISTRATION
, it is.
2) Yes, sure no problem. Remark, what is not possible is: Having the same class multiple times in the class hierarchy. E.g:
- base
*- derived: base
- master : derived_1, base
Thanks you for the aclaration of the second one, regarding the first one...
My entity system framework relied some Reflect tricks to make the Component class lightweight enough due those components are pre-allocated in a cache-coherent memory pool, so when you call an "Component" class from RTTR in reality you're calling the proxy classes.
Also another possiblity is i create a class, but there's no reflection yet, until i call an function which does this later, the reflected type will not be visible to RTTR until i call that function.
Does 1) Answer your question? Yes, you can defer the registration process, but you have to make sure you are not register multiple types at the same time. Otherwise I not yet understand your question.
Alright, thats all what i need, Thanks you for your quick response. sorry about the confusion, my english isn't my main language.
Hello!.
I found your reflection library really interesting and worth to try an shot to my projects, replacing an older reflection library called Reflect by HeliumProject, and already started to port my existent frameworks from Reflect to RTTR but i stepped in this issue: Deferred Type Reflection, i mean register an type (such an class or struct) when i enter into a function.
for example in the older Reflect library did something like this:
When someone calls this class, this will register the base class and after the actual class,
BaseT::s_ComponentRegistrar.Register();
consider that function is the same likevoid ComponentRegistrar<ClassT, void>::Register()
which register just the class. i wonder if this would work. The old Reflect library keeps an global hashmap of all registered types.Other question is about RTTR support class hierarchy of two different class inherits the same class hierarchy for exmaple this tree.