Comments (5)
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.
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.
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.
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.
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)
- License HOT 1
- Unit testing HOT 3
- Allow reflifc types to be assignable.
- Make reflifc types classes HOT 1
- Support Declaration::{Specialization, PartialSpecialization}
- Support Expression::TemplateReference HOT 1
- Make reflifc types hashable and Comparable. HOT 3
- Ability to get reflifc::Module from any reflifc object. HOT 7
- `using enum` is only supported in clang >= 13 HOT 2
- Parenthesized initialization of aggregates is unsupported in `clang`
- `d.json` suffix doesn't match MSVC HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ifc-reader.