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

How to instantiate a transform? #433

Closed
spyridon97 opened this issue Feb 9, 2024 · 7 comments
Closed

How to instantiate a transform? #433

spyridon97 opened this issue Feb 9, 2024 · 7 comments

Comments

@spyridon97
Copy link
Contributor

In the past, Iotr::Factory was part of Ioss_transform.h.

This has been moved in Iotr_Factory.h

Are we supposed to include Iotr_Factory.h to create a transform such as

    auto transform = std::unique_ptr<Ioss::Transform>(Iotr::Factory::create("offset"));
    transform->set_property("offset", -1);

Or is there another way, such that we don't need to include?

@gsjaardema
Copy link
Member

That should be how it is done. You need to include transform/Iotr_Factory.h

The change was made about a year ago:

commit 5fa52564b446a67c7058060ce2ef520a099a98d6
Author: Ben Boeckel <[email protected]>
Date:   Wed Oct 26 12:34:44 2022 -0400

    ioss: move Iotr_Factory to its own header

    In the right library of course.

@spyridon97
Copy link
Contributor Author

maybe it would be convenient to have a create factory function in ioss_transform.h. which internally would return a Iotr::Factory.

@gsjaardema
Copy link
Member

Yes, maybe Ioss::Transform *Ioss::create_transform(const std::string &transform_type)

@gsjaardema
Copy link
Member

I will have to think about this some more -- the simple implementation makes Ioss library depend on Iotr library which is the reverse of how it should be... I will look more at Iotr::Factory and see whether it really needs to be in the Iotr library, or whether it could live at the IOSS level (which is where it was at one time...)

@spyridon97
Copy link
Contributor Author

Maybe you could have Ioss::TransformFactory like Ioss::IOFactory. And remove Iotr::Factory.

@gsjaardema
Copy link
Member

See #434

@gsjaardema
Copy link
Member

I tihnk this can be closed. Please reopen if still problems with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants