GithubHelp home page GithubHelp logo

Classes split over multiple files about hyde HOT 4 OPEN

adobe avatar adobe commented on June 8, 2024
Classes split over multiple files

from hyde.

Comments (4)

fosterbrereton avatar fosterbrereton commented on June 8, 2024

The tool currently works on a per-file basis. The main reason for this is to accurately detect the existence of docs that shouldn't be around anymore (because an API was either moved or deleted.)

If you were to compile a program, b.hpp requires a.hpp be included in order to pass compilation. Since hyde is a compiler, this requirement still holds here.

A couple fixes could address the situation. hyde could be improved to better handle multi-file situations like this. You could also modify b.hpp to properly include its dependencies. Given that the latter has to happen in order for b.hpp to compile as a bona fide program, I'd try that route first.

from hyde.

mrzv avatar mrzv commented on June 8, 2024

b.hpp is an implementation detail. It should never be included on its own. I suppose adding #include "a.hpp" to it is harmless, but redundant.

To me this is a bug in hyde. It's a pretty common practice in header-only libraries to split definition and implementation. This is admittedly a somewhat extreme case of that, but it's valid C++. It seems hyde should support it.

As for deleted API, shouldn't it be the other way around? Shouldn't hyde ingest everything in the library and based on that decide whether something has been removed. If a class is simply moved to a different file, the documentation shouldn't change (or be lost).

from hyde.

X-Ryl669 avatar X-Ryl669 commented on June 8, 2024

In the PImpl idiom, you want the PImpl to be hidden. As such, B should not be documented (except as an opaque struct/class). If you want your user to actually use B, then make its declaration visible as @fosterbrereton says, it's no more PImpl. Usually, in such idiom, you'll define B in a CPP file (not a header file), since no-one should be able to use/instantiate it except A.

from hyde.

mrzv avatar mrzv commented on June 8, 2024

I'm not sure what PImpl idiom has to do with anything, but I'm sure that a documentation tool should not dictate how a user is to organize their code. That would be the proverbial tail wagging the dog.

I very much hope this issue gets fixed somehow. I think hyde's out-of-source design is brilliant, and I'd love to use, but with the current per-file processing, I simply can't.

from hyde.

Related Issues (20)

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.