Create class diagram from c++ source? - c++

Is there any free tools available for generating class diagram from c++ source files and if possible for mfc source files too.

We use doxygen with graphviz support

You could try SourceNavigator. I'm not sure what the current state of the project is, but here's a place to start.

I've had some success with Umbrello (a KDE-based app). It allows you to import code to create a model, that can then be used to generate UML diagrams.

Umbrello is probably fine for projects with a limited number of classes, and certainly requires manual intervention for tuning. I imagine doxygen/graphviz is more suitable for larger projects.

Related

create a project from a template

I have several project setups in very different languages. For example an android project.
Whenever I want to create a new android project I copy that project, rename everything I need to rename and I have a ready to go project with which I start working.
Since this is very time consuming and I am sure this can be automated I thought about creating a tool that does this for me, but then I thought there are probably thousand solutions out there, which solve the exact same problem already, I am just not aware of.
So my question is, do you know of any tools like this? The requirements I see are, that it has to be os, language, IDE independent and it must support a command line interface. Ideally with less setup effort.
You should try Telosys (https://www.telosys.org) a lightweight code generator that is able to generate any kind of langage with any kind of framework.
This tool is quite simple, free and Open Source.
It provides a Command Line Interface (so it can be used with any environment/IDE).
It is usualy used to boostrap a project and to generated all the repetitive code (CRUD, Controllers, unit tests, HTML pages, etc)
See also :
https://modeling-languages.com/telosys-tools-the-concept-of-lightweight-model-for-code-generation/
https://www.slideshare.net/lguerin/telosys-project-booster-paris-open-source-summit-2019

Free UML tool with c++ code generation and doxygen support

I know features such as code generation and doxygen support are usually considered commercial, but I was wondering if there are any free UML tools that support c++ code generation which supports doxygen documentation?
It would be very useful to produce a model with documentation and not have to repeat/edit this to enable the doxygen support.
EDIT: Forgot to mention I am developing under Linux (Ubuntu)
StarUML should be able to do it.
For free and very simple to use there is dia (vectorial diagram editor) with UML + dia2code
works for "ada|c|cpp|csharp|idl|java|php|php5|python|ruby|shp|sql"
First you draw your UML Class diagram, save it, and than use dia2code on the .dia file.
Since I also tried umbrello (userbase.kde.org/Umbrello) which has more features such as importing code, package/namespace...
Try BOUML, it's an excellent multiplatform UML toolbox

Software for browsing classes in a C/C++ project

I have seen that some developers have a graphical representation of all their classes in an image file which comes with their project. How can I myself create these graphics?
Basically they show what classes exist in a file and how these files relate to each other.
Thanks
Doxygen allows you to generate interactive class diagrams. Check out this page: http://www.doxygen.nl/manual/diagrams.html how to set it up.
It might be Doxygen, a software that generates documentation with dependancy graphs.
Eclipse has the ability to generate class diagrams and export them as images.
One common tool that allows people to do that fairly easily is Dot, which comes as part of Graphviz. Dot is sort of a markup language describing graphs. You can generate Dot files manually if you like, but there are a lot of code analysis tools that will do the job for you. Doxygen is one.
Another great tool for creating UML class diagrams is Dia.

C++ code to class diagram

Is there is a way I can generate a hierachial class diagram from C++ code. My code is spread over 5 to 6 .cpp files.
I would like to know if there is any free tool for the same.
Regards,
AJ
There's e.g. doxygen
http://www.doxygen.nl/manual/features.html says:
Uses the dot tool of the Graphviz tool kit to generate include dependency graphs, collaboration diagrams, call graphs, directory structure graphs, and graphical class hierarchy graphs.
It creates graphs like
(from http://www.vtk.org/doc/nightly/html/structvtkKdTree_1_1__cellList.html, an example listed on the doxygen site)
Since the question was about class diagrams you might also be interested in the UML_LOOK flag that makes the ouput a bit more uml-like.
Class diagrams are networks, not hierarchies. There a re quite a few tools that can generate them - my favourite is Enterprise Architect, but it isn't free (there is a trial).
Umberello is the Linux application that generate diagram from code.
Doxygen can create class-diagrams. However, I believe these diagrams are only to show the network of classes, they do not list methods and members and such.

Good, simple configuration library for large c++ project?

We are developing a rather large project in C++, where many components require configuration parameters. We would like to use a central place to configure everything (like a registry), preferably with a nice and simple GUI (e.g. like Firefox's about:config) and a simple API.
I am pretty sure this that many applications have this kind of problem, but could not find any libraries available that can be readily used for this. Does anyone know of a good (preferably free) library to use for this?
This should work cross platform in Windows and Linux.
boost::program_options provides unified (and cross platform) support for configuration from command line, environment variables and configuration files. It seems like it ought to scale to multiple bits of a large software system registering an interest in various parameters (e.g option groups). Not much help with the GUI or persistence side of things though (but then what's wrong with editing a config file with a text editor ?).
I've used libconfig before, works well easy and LGPL.
http://www.hyperrealm.com/libconfig/
I've used a modified version of John Torjo code from TechRepublic/DDJ (source)
The multi platform ACE library has a configuration class that uses config files that have the Windows .ini format.
I've often used a simple wrapper around pugxml. I find that creating a configuration class with parameter validation for enumerated types and so on makes the rest of the code much cleaner. If you are just dealing with key/value pairs you will have to validate the data all throughout your code. By writing a custom class for each application you can put all that in one place.
Try Configurator. There is no GUI, but it's easy-to-use and flexible C++ library for configuration file parsing (from simplest INI to complex files with arbitrary nesting and semantic checking). Header-only and cross-platform. Uses Boost C++ libraries.
See: http://opensource.dshevchenko.biz/configurator