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

Replace AutoDestructableConstructor That Has The 2 Parameters Of (Legacy_Object *, const char *) With Only The (Legacy_Object*) Parameter #34

Open
taljacob2 opened this issue Jan 4, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@taljacob2
Copy link
Owner

When using AutoDestructable,

Replace:

instance->autoDestructable = AutoDestructableConstructorWithClassName(
        (Legacy_Object *) instance,
        instance->legacyObjectComponent->CLASS_NAME);

With

instance->autoDestructable = AutoDestructableConstructorWithClassName(
        (Legacy_Object *) instance);

And the CLASS_NAME will be defined automatically via instance->legacyObjectComponent->CLASS_NAME.

in case instance == NULL, then CLASS_NAME is AutoDestructable.


  • That means, that maybe we can entirely replace the AutoDestructableConstructor that has the parameters (Legacy_Object *, const char *) with only the (Legacy_Object*) parameter.
    • And that means, we need to modify the addImplementationThatIsConstructedWithLegacy_ObjectAsParameter method in Object.c / Object.r to receive a constructor that gets only one parameter of (Legacy_Object *).
@taljacob2 taljacob2 added enhancement New feature or request question Further information is requested labels Jan 4, 2023
@taljacob2 taljacob2 self-assigned this Jan 4, 2023
@taljacob2
Copy link
Owner Author

taljacob2 commented Jan 4, 2023

  • And then, a Legacy interface (with the "className" of Legacy_INTERFACE for example) will be defined to be:

    Legacy_INTERFACEConstructor(Legacy_Object *) {
    ...
    }

    (So AutoDestructable is actually a Legacy_Interface)

  • And then, an interface (with the "className" of INTERFACE for example) will be defined to be:

    INTERFACEConstructor(Object *) {
    ...
    }

@taljacob2
Copy link
Owner Author

taljacob2 commented Jan 4, 2023

That also means we could remove entirely the parameterless AutoDestructableConstructor().
And replace it with the one and only AutoDestructableConstructor(Legacy_Object *).

That also means we could verify that there is no need for the Constructable old "struct interface" like said in #15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
Status: Todo
Development

No branches or pull requests

1 participant