Giter Site home page Giter Site logo

Remove boost dependency about ifc-reader HOT 5 CLOSED

andreyg avatar andreyg commented on July 28, 2024
Remove boost dependency

from ifc-reader.

Comments (5)

AndreyG avatar AndreyG commented on July 28, 2024 1

It sounds good for me. One minor clarification, that I would prefer std::span<const std::byte> instead of raw pointer const char*.

from ifc-reader.

AndreyG avatar AndreyG commented on July 28, 2024

I have moved dependency on boost-iostream from ifc-core to ifc-msvc, so now it's possible to use ifc-core without Boost, see tests/core for instance.

from ifc-reader.

FireFlyForLife avatar FireFlyForLife commented on July 28, 2024

This is a good start for sure, and the std::span is indeed a bit safer. But just moving it from ifc-core to ifc-msvc still means that clients of ifc-core have to have boost installed, otherwise CMake fails to find the dependency and throws an error.

Furthermore it seems to me the ifc environment (be it msvc specific or not) should not dictate how the files should be loaded from disk. I do see how adding that abstraction is difficult though, as it needs to keep track of state.

What do you think of a similar interface to

class ifc::Environment{
public:
    virtual ~Environment() = default;

    virtual const File& get_file_by_bmi_path(stdfs::path) const;
    virtual const File& get_file_by_module_name(std::string_view) const;
};

We define a "Loader" or "DataManager" interface.

class ifc::DataLoader {
public:
    virtual ~DataLoader() = default;

    virtual const File& load_from_disk(stdfs::path);
    virtual void unload_file(stdfs::path); // Or possibly by ifc::File&
};

Then ifc::MSVCEnvironment would take a DataLoader*. And the MSVC specific logic could still be abstracted, and kept up to date in the library. But no one is locked into using Boost to load the files. We could have an optional module exposed with that boost file_mapped implementation, which the tests & example would use.

from ifc-reader.

AndreyG avatar AndreyG commented on July 28, 2024

I have reworked subdivision to libraries and concept of ifc::Environment, see README. It is pretty close to what you suggested, ifc-msvc doesn't depend on Boost now. Please, let me know, it it works for you.

from ifc-reader.

FireFlyForLife avatar FireFlyForLife commented on July 28, 2024

Sorry it has been a bit since I took a look at my project, but now that I got to try it out I like the separation. This issue for me is resolved! Thanks for doing this :)

from ifc-reader.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.