Giter Site home page Giter Site logo

svlad-90 / dma_plantuml Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 394 KB

Tiny C++ library, which allows your application to build plantuml class diagrams regarding its own entities

License: Apache License 2.0

CMake 1.26% C++ 98.74%
class-diagrams cpp-to-plantuml plantuml uml

dma_plantuml's People

Contributors

svlad-90 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dma_plantuml's Issues

[DIAGRAMS] Extend API with the "export all diagrams" call

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;

[Bug] Standalone diagrams have inheritance classes declared outside any packages

When I use Creator::getPackageClassDiagram with "excludeDependencies" equal to true - created diagrams have inheritance classes declared outside any packages, which is wrong:

https://github.com/svlad-90/DLT-Message-Analyzer/blob/feature/ISSUE_72/dltmessageanalyzerplugin/src/log/doc/doc.md

image

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.

[GENERAL] Prepare repository for work

There are the following parts of this task

  • Add automated builds for clang-tidy, Linux, windows, repo size update
  • Add usage of the gtest framework

DMA_Plantuml.cpp: error C2039: 'tolower': is not a member of 'std'

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

[GENRATION_AUTOMATION] Add possibility to generate diagrams on the fly, using the libclang

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 libclang could be used in order to parse the code, considering specific C++ standards, and the defines used in the project.
  • A configuration file can be used in order to configure the level of the detail of the generated model.
  • A set of CMake rules could be defined in order to allow easier integration of the tool into the CMake-based projects

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.

[DIAGRAMS] Add support of the member-fields

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)

[Enhancement] integrate all the latest updates, which were implemented in DLT-Message-Analyzer repository

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:

  • Fix bugs of the diagrams generation. Not all elements were included properly in the "package + 1 level of dependencies" approach
  • Support of work with templates
  • Support of singletons
  • Support of the abstract classes
  • Support of "use" dependency type
  • Support of template classes
  • Support of the basic type check mechanism
  • Addition of support of the inheritance declaration to the interfaces
  • Update of README & header comments

[COMPONENT_DIAGRAMS] Add support of component diagrams

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:

  • define a component
  • define interfaces, which it uses
  • define interfaces, which it is providing
  • define to which package it is related
    etc.

On top of that, some new helpers should be defied to allow generation of the plantuml component diagram

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.