svlad-90 / dma_plantuml Goto Github PK
View Code? Open in Web Editor NEWTiny C++ library, which allows your application to build plantuml class diagrams regarding its own entities
License: Apache License 2.0
Tiny C++ library, which allows your application to build plantuml class diagrams regarding its own entities
License: Apache License 2.0
I'm using this concept in several projects so far. It is quite a time-consuming thing to implement the export of diagrams to the file-system separately from the lib in each project, where it is being used.
It is better to do this functionality part of the lib. We need requests which would be something like:
typedef std::map<std::string, tClassDiagramResult> tBatchClassDiagramResult;
/**
* @brief getAllPackageClassDiagrams - gets filtered class diagram of sub-set of the
* registered elements for EACH existing package.
* @param excludeDependencies - whether we should represent package WITHOUT its
* first level external dependencies
* @return - instance of tBatchClassDiagramResult struct, which contains content of
* each generated diagram, in case if tClassDiagramResult::bIsSuccessful == true.
* Otherwise returns an error message for each failed operation.
* Note! This method will proceed on error.
*/
tBatchClassDiagramResult getAllPackageClassDiagrams(bool excludeDependencies = false) const;
struct tClassDiagramExportResult
{
bool bIsSuccessful = false;
std::string error;
};
/**
* @brief exportClassDiagram - exports full class diagram of all registered
* elements.
* @param exportPath - target export directory path. Should be separated with the
* forward slashes - "/", but WITHOUT forward slash at the end.
* @return - instance of tClassDiagramExportResult struct, which contains the
* status of the operation and ( in case of failure ) the error string.
*/
tClassDiagramExportResult exportClassDiagram( const std::string& exportPath ) const;
/**
* @brief exportPackageClassDiagram - exports filtered class diagram of sub-set of
* the registered elements.
* @param exportPath - target export directory path. Should be separated with the
* forward slashes - "/", but WITHOUT forward slash at the end.
* @param packageName - name of target package, for which the diagram should be
* created. Diagram will show target package and first level of its dependencies.
* @param excludeDependencies - whether we should represent package WITHOUT its
* first level external dependencies
* @return - instance of tClassDiagramExportResult struct, which contains the
* status of the operation and ( in case of failure ) the error string.
*/
tClassDiagramExportResult exportPackageClassDiagram( const std::string& exportPath,
const std::string& packageName,
bool excludeDependencies = false ) const;
typedef std::map<std::string, tClassDiagramExportResult> tClassDiagramBatchExportResult;
/**
* @brief exportAllPackageClassDiagrams - exports all package class diagrams to the
* target folder.
* @param exportPath - target export directory path. Should be separated with the
* forward slashes - "/", but WITHOUT forward slash at the end.
* @param excludeDependencies - whether we should represent package WITHOUT its
* first level external dependencies
* @return - instance of tClassDiagramBatchExportResult struct, which contains the
* status of each performed export operation and ( in case of failure ) the error
* string.
* Note! This method will proceed on error.
*/
tClassDiagramBatchExportResult exportAllPackageClassDiagrams( const std::string& exportPath,
bool excludeDependencies = false ) const;
When I use Creator::getPackageClassDiagram with "excludeDependencies" equal to true - created diagrams have inheritance classes declared outside any packages, which is wrong:
In the above example, QObject & QPlaintTextEdit classes are declared as part of the Qt package. So it is expected, that classes will be represented inside the Qt package.
There are the following parts of this task
Describe the bug
Compile error on Windows as part svlad-90/DLT-Message-Analyzer:
[ 45%] Building CXX object _deps/dma_plantuml-build/DMA_Plantuml/src/CMakeFiles/DMA_Plantuml.dir/DMA_Plantuml.cpp.obj
DMA_Plantuml.cpp
E:\Repo\dlt-viewer\build-cmake-nmake\_deps\dma_plantuml-src\DMA_Plantuml\src\DMA_Plantuml.cpp(968): error C2039: 'tolower': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.16.27023\include\mutex(26): note: see declaration of 'std'
E:\Repo\dlt-viewer\build-cmake-nmake\_deps\dma_plantuml-src\DMA_Plantuml\src\DMA_Plantuml.cpp(978): error C2039: 'tolower': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.16.27023\include\mutex(26): note: see declaration of 'std'
To Reproduce
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0
WindowsSDKVersion=10.0.19041.0
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC
VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.16.27023
VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Redist\MSVC\14.29.30133
VCToolsVersion=14.16.27023
My environment uses Windows SDK version 10.0.19041.0 and MSVC compiler version 14.16 (VS 2017) with Qt5.14.2
Expected behavior
Code compiles without errors
The macro definitions, which are represented in the project initially looked OK.
BUT! The big improvement would be to allow the compilation of the executable, the tool, which will parse the C++ code of the project and will generate the platnuml diagrams on the fly, without the need of any manually written glue-code.
Some general statements:
The result of this task should be the merged PR with the requested changes. For sure, it will take a long time to achieve that. But in case of success, this tool might become more widely used.
Something went wrong with the windows build. In order to debug the failing case, we need to be able to trigger the build execution manually.
In order to cover more complex projects, it is required to add member fields to the class diagrams. We need to add support of the following 2 macro-definitions:
PUML_MEMBER(ACCESS_MODIFIER, MEMBER)
PUML_STATIC_MEMBER(ACCESS_MODIFIER, MEMBER)
The main part of the development of this tool as of now is done here: https://github.com/svlad-90/DLT-Message-Analyzer
During the development of DMA, some extensions of DMA_Plantuml are also made.
It is time to integrate all the latest updates to this repository.
Those include:
Windows build is failing on CI/CD - https://github.com/svlad-90/DMA_Plantuml/runs/5110116778?check_suite_focus=true
We need to fix the build.
It would be good to extend the lib with the possibility to form the component diagram model & component diagram plantuml diagram.
That includes a need to define new macro definitions in order to:
On top of that, some new helpers should be defied to allow generation of the plantuml component diagram
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.